<!DOCTYPE html>
<html lang="zh" dir="ltr" class="client-nojs">
<head>
<title>标准库头文件 &lt;ranges&gt;</title>
<meta charset="UTF-8">
<meta name="generator" content="MediaWiki 1.21.2">
<link rel="shortcut icon" href="../../../common/favicon.ico">
<link rel="stylesheet" href="../../../common/ext.css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" href="../../../common/site_modules.css">
<style>a:lang(ar),a:lang(ckb),a:lang(fa),a:lang(kk-arab),a:lang(mzn),a:lang(ps),a:lang(ur){text-decoration:none}#toc{display:none}.editsection{display:none}
/* cache key: mwiki1-mwiki_zh_:resourceloader:filter:minify-css:7:15cea3ec788a65b5187d4018eed543bf */</style>

<script src="../../../common/startup_scripts.js"></script>
<script>if(window.mw){
mw.config.set({"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"cpp/header/ranges","wgTitle":"cpp/header/ranges","wgCurRevisionId":70022,"wgArticleId":11952,"wgIsArticle":true,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":[],"wgBreakFrames":false,"wgPageContentLanguage":"zh","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"zh","wgMonthNames":["","1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],"wgMonthNamesShort":["","1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],"wgRelevantPageName":"cpp/header/ranges","wgUserVariant":"zh","wgRestrictionEdit":[],"wgRestrictionMove":[]});
}</script><script>if(window.mw){
mw.loader.implement("user.options",function(){mw.user.options.set({"ccmeonemails":0,"cols":80,"date":"default","diffonly":0,"disablemail":0,"disablesuggest":0,"editfont":"default","editondblclick":0,"editsection":0,"editsectiononrightclick":0,"enotifminoredits":0,"enotifrevealaddr":0,"enotifusertalkpages":1,"enotifwatchlistpages":0,"extendwatchlist":0,"externaldiff":0,"externaleditor":0,"fancysig":0,"forceeditsummary":0,"gender":"unknown","hideminor":0,"hidepatrolled":0,"imagesize":2,"justify":0,"math":1,"minordefault":0,"newpageshidepatrolled":0,"nocache":0,"noconvertlink":0,"norollbackdiff":0,"numberheadings":0,"previewonfirst":0,"previewontop":1,"quickbar":5,"rcdays":7,"rclimit":50,"rememberpassword":0,"rows":25,"searchlimit":20,"showhiddencats":0,"showjumplinks":1,"shownumberswatching":1,"showtoc":0,"showtoolbar":1,"skin":"cppreference2","stubthreshold":0,"thumbsize":2,"underline":2,"uselivepreview":0,"usenewrc":0,"watchcreations":0,"watchdefault":0,"watchdeletion":0,
"watchlistdays":3,"watchlisthideanons":0,"watchlisthidebots":0,"watchlisthideliu":0,"watchlisthideminor":0,"watchlisthideown":0,"watchlisthidepatrolled":0,"watchmoves":0,"wllimit":250,"variant":"zh","language":"zh","searchNs0":true,"searchNs1":false,"searchNs2":false,"searchNs3":false,"searchNs4":false,"searchNs5":false,"searchNs6":false,"searchNs7":false,"searchNs8":false,"searchNs9":false,"searchNs10":false,"searchNs11":false,"searchNs12":false,"searchNs13":false,"searchNs14":false,"searchNs15":false,"gadget-MathJax":1,"gadget-ColiruCompiler":1});;},{},{});mw.loader.implement("user.tokens",function(){mw.user.tokens.set({"editToken":"+\\","patrolToken":false,"watchToken":false});;},{},{});
/* cache key: mwiki1-mwiki_zh_:resourceloader:filter:minify-js:7:258d7cd6aa9aa67dee25e01fb6a9e505 */
}</script>
<script>if(window.mw){
mw.loader.load(["mediawiki.page.startup","mediawiki.legacy.wikibits","mediawiki.legacy.ajax"]);
}</script>
<style type="text/css">/*<![CDATA[*/
.source-cpp {line-height: normal;}
.source-cpp li, .source-cpp pre {
	line-height: normal; border: 0px none white;
}
/**
 * GeSHi Dynamically Generated Stylesheet
 * --------------------------------------
 * Dynamically generated stylesheet for cpp
 * CSS class: source-cpp, CSS id: 
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 * --------------------------------------
 */
.cpp.source-cpp .de1, .cpp.source-cpp .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}
.cpp.source-cpp  {font-family:monospace;}
.cpp.source-cpp .imp {font-weight: bold; color: red;}
.cpp.source-cpp li, .cpp.source-cpp .li1 {font-weight: normal; vertical-align:top;}
.cpp.source-cpp .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}
.cpp.source-cpp .li2 {font-weight: bold; vertical-align:top;}
.cpp.source-cpp .kw1 {color: #0000dd;}
.cpp.source-cpp .kw2 {color: #0000ff;}
.cpp.source-cpp .kw3 {color: #0000dd;}
.cpp.source-cpp .kw4 {color: #0000ff;}
.cpp.source-cpp .co1 {color: #909090;}
.cpp.source-cpp .co2 {color: #339900;}
.cpp.source-cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp.source-cpp .es0 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es1 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es2 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es3 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es4 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es5 {color: #008000; font-weight: bold;}
.cpp.source-cpp .br0 {color: #008000;}
.cpp.source-cpp .sy0 {color: #008000;}
.cpp.source-cpp .sy1 {color: #000080;}
.cpp.source-cpp .sy2 {color: #000040;}
.cpp.source-cpp .sy3 {color: #000040;}
.cpp.source-cpp .sy4 {color: #008080;}
.cpp.source-cpp .st0 {color: #008000;}
.cpp.source-cpp .nu0 {color: #000080;}
.cpp.source-cpp .nu6 {color: #000080;}
.cpp.source-cpp .nu8 {color: #000080;}
.cpp.source-cpp .nu12 {color: #000080;}
.cpp.source-cpp .nu16 {color:#000080;}
.cpp.source-cpp .nu17 {color:#000080;}
.cpp.source-cpp .nu18 {color:#000080;}
.cpp.source-cpp .nu19 {color:#000080;}
.cpp.source-cpp .ln-xtra, .cpp.source-cpp li.ln-xtra, .cpp.source-cpp div.ln-xtra {background-color: #ffc;}
.cpp.source-cpp span.xtra { display:block; }

/*]]>*/
</style><!--[if lt IE 7]><style type="text/css">body{behavior:url("/mwiki/skins/cppreference2/csshover.min.htc")}</style><![endif]--></head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-cpp_header_ranges skin-cppreference2 action-view cpp-navbar">
        <!-- header -->
        <!-- /header -->
        <!-- content -->
<div id="cpp-content-base">
            <div id="content">
                <a id="top"></a>
                <div id="mw-js-message" style="display:none;"></div>
                                <!-- firstHeading -->
<h1 id="firstHeading" class="firstHeading"><span style="font-size:0.7em; line-height:130%">标准库头文件</span> &lt;ranges&gt;</h1>
                <!-- /firstHeading -->
                <!-- bodyContent -->
                <div id="bodyContent">
                                        <!-- tagline -->
                    <div id="siteSub">来自cppreference.com</div>
                    <!-- /tagline -->
                                        <!-- subtitle -->
                    <div id="contentSub"><span class="subpages">&lt; <a href="../../cpp.html" title="cpp">cpp</a>‎ | <a href="../header.html" title="cpp/header">header</a></span></div>
                    <!-- /subtitle -->
                                                            <!-- bodycontent -->
                    <div id="mw-content-text" lang="zh" dir="ltr" class="mw-content-ltr"><div class="t-navbar" style=""><div class="t-navbar-sep"> </div><div class="t-navbar-head"><a href="../../cpp.html" title="cpp"> C++</a><div class="t-navbar-menu"><div><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="../language.html" title="cpp/language">语言</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../header.html" title="cpp/header">标准库头文件</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../freestanding.html" title="cpp/freestanding"> 自立与有宿主实现</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../named_req.html" title="cpp/named req">具名要求</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../utility.html#.E8.AF.AD.E8.A8.80.E6.94.AF.E6.8C.81" title="cpp/utility">语言支持库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../concepts.html" title="cpp/concepts">概念库</a> <span class="t-mark-rev t-since-cxx20">(C++20)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../error.html" title="cpp/error">诊断库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../utility.html" title="cpp/utility">工具库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../string.html" title="cpp/string">字符串库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../container.html" title="cpp/container">容器库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../iterator.html" title="cpp/iterator">迭代器库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../ranges.html" title="cpp/ranges"> 范围库</a> <span class="t-mark-rev t-since-cxx20">(C++20)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../algorithm.html" title="cpp/algorithm">算法库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../numeric.html" title="cpp/numeric">数值库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../locale.html" title="cpp/locale">本地化库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../io.html" title="cpp/io">输入/输出库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../filesystem.html" title="cpp/filesystem">文件系统库</a> <span class="t-mark-rev t-since-cxx17">(C++17)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../regex.html" title="cpp/regex">正则表达式库</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../atomic.html" title="cpp/atomic">原子操作库</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../thread.html" title="cpp/thread">线程支持库</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../experimental.html" title="cpp/experimental">技术规范</a> </td></tr>
</table></div><div></div></div></div></div><div class="t-navbar-sep"> </div><div class="t-navbar-head"><a href="../header.html" title="cpp/header"> 标准库头文件</a><div class="t-navbar-menu"><div><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv-h2"><td colspan="5"> 语言支持</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="cstddef.html" title="cpp/header/cstddef"><tt>&lt;cstddef&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="cstdlib.html" title="cpp/header/cstdlib"><tt>&lt;cstdlib&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="version.html" title="cpp/header/version"><tt>&lt;version&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="limits.html" title="cpp/header/limits"><tt>&lt;limits&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="climits.html" title="cpp/header/climits"><tt>&lt;climits&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="cfloat.html" title="cpp/header/cfloat"><tt>&lt;cfloat&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="cstdint.html" title="cpp/header/cstdint"><tt>&lt;cstdint&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="new.html" title="cpp/header/new"><tt>&lt;new&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="typeinfo.html" title="cpp/header/typeinfo"><tt>&lt;typeinfo&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <br>
</td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="source_location.html" title="cpp/header/source location"><tt>&lt;source_location&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="exception.html" title="cpp/header/exception"><tt>&lt;exception&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="initializer_list.html" title="cpp/header/initializer list"><tt>&lt;initializer_list&gt;</tt></a>    </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="compare.html" title="cpp/header/compare"><tt>&lt;compare&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <br>
</td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="coroutine.html" title="cpp/header/coroutine"><tt>&lt;coroutine&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="csignal.html" title="cpp/header/csignal"><tt>&lt;csignal&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="csetjmp.html" title="cpp/header/csetjmp"><tt>&lt;csetjmp&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="cstdarg.html" title="cpp/header/cstdarg"><tt>&lt;cstdarg&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <br>
</td></tr>
</table></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> 概念</td></tr>
<tr class="t-nv"><td colspan="5"> <a href="concepts.html" title="cpp/header/concepts"><tt>&lt;concepts&gt;</tt></a></td></tr>
<tr class="t-nv-h2"><td colspan="5"> 诊断</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="stdexcept.html" title="cpp/header/stdexcept"><tt>&lt;stdexcept&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="cassert.html" title="cpp/header/cassert"><tt>&lt;cassert&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="cerrno.html" title="cpp/header/cerrno"><tt>&lt;cerrno&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="system_error.html" title="cpp/header/system error"><tt>&lt;system_error&gt;</tt></a></td></tr>
</table></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> 通用工具</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="utility.html" title="cpp/header/utility"><tt>&lt;utility&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="memory.html" title="cpp/header/memory"><tt>&lt;memory&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="memory_resource.html" title="cpp/header/memory resource"><tt>&lt;memory_resource&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="scoped_allocator.html" title="cpp/header/scoped allocator"><tt>&lt;scoped_allocator&gt;</tt></a>    </td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="bitset.html" title="cpp/header/bitset"><tt>&lt;bitset&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="tuple.html" title="cpp/header/tuple"><tt>&lt;tuple&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="optional.html" title="cpp/header/optional"><tt>&lt;optional&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="any.html" title="cpp/header/any"><tt>&lt;any&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="variant.html" title="cpp/header/variant"><tt>&lt;variant&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="type_traits.html" title="cpp/header/type traits"><tt>&lt;type_traits&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="ratio.html" title="cpp/header/ratio"><tt>&lt;ratio&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="chrono.html" title="cpp/header/chrono"><tt>&lt;chrono&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="typeindex.html" title="cpp/header/typeindex"><tt>&lt;typeindex&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="functional.html" title="cpp/header/functional"><tt>&lt;functional&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="stacktrace.html" title="cpp/header/stacktrace"><tt>&lt;stacktrace&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="ctime.html" title="cpp/header/ctime"><tt>&lt;ctime&gt;</tt></a></td></tr>
</table></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> 字符串</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="string.html" title="cpp/header/string"><tt>&lt;string&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="string_view.html" title="cpp/header/string view"><tt>&lt;string_view&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="cstring.html" title="cpp/header/cstring"><tt>&lt;cstring&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="charconv.html" title="cpp/header/charconv"><tt>&lt;charconv&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="format.html" title="cpp/header/format"><tt>&lt;format&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <br>
</td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="cctype.html" title="cpp/header/cctype"><tt>&lt;cctype&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="cwctype.html" title="cpp/header/cwctype"><tt>&lt;cwctype&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <br>
</td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="cwchar.html" title="cpp/header/cwchar"><tt>&lt;cwchar&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="cuchar.html" title="cpp/header/cuchar"><tt>&lt;cuchar&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <br>
</td></tr>
</table></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> 本地化</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="locale.html" title="cpp/header/locale"><tt>&lt;locale&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="codecvt.html" title="cpp/header/codecvt"><tt>&lt;codecvt&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="clocale.html" title="cpp/header/clocale"><tt>&lt;clocale&gt;</tt></a></td></tr>
</table></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> 容器</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="span.html" title="cpp/header/span"><tt>&lt;span&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="array.html" title="cpp/header/array"><tt>&lt;array&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="vector.html" title="cpp/header/vector"><tt>&lt;vector&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="deque.html" title="cpp/header/deque"><tt>&lt;deque&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="forward_list.html" title="cpp/header/forward list"><tt>&lt;forward_list&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="list.html" title="cpp/header/list"><tt>&lt;list&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="map.html" title="cpp/header/map"><tt>&lt;map&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="set.html" title="cpp/header/set"><tt>&lt;set&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="queue.html" title="cpp/header/queue"><tt>&lt;queue&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="unordered_map.html" title="cpp/header/unordered map"><tt>&lt;unordered_map&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="unordered_set.html" title="cpp/header/unordered set"><tt>&lt;unordered_set&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="stack.html" title="cpp/header/stack"><tt>&lt;stack&gt;</tt></a></td></tr>
</table></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> 迭代器</td></tr>
<tr class="t-nv"><td colspan="5"> <a href="iterator.html" title="cpp/header/iterator"><tt>&lt;iterator&gt;</tt></a></td></tr>
<tr class="t-nv-h2"><td colspan="5"> 范围</td></tr>
<tr class="t-nv"><td colspan="5"> <strong class="selflink"><tt>&lt;ranges&gt;</tt></strong></td></tr>
<tr class="t-nv-h2"><td colspan="5"> 算法</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="algorithm.html" title="cpp/header/algorithm"><tt>&lt;algorithm&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="execution.html" title="cpp/header/execution"><tt>&lt;execution&gt;</tt></a></td></tr>
</table></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> 数值</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="complex.html" title="cpp/header/complex"><tt>&lt;complex&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="random.html" title="cpp/header/random"><tt>&lt;random&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="valarray.html" title="cpp/header/valarray"><tt>&lt;valarray&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="numeric.html" title="cpp/header/numeric"><tt>&lt;numeric&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="bit.html" title="cpp/header/bit"><tt>&lt;bit&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="numbers.html" title="cpp/header/numbers"><tt>&lt;numbers&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="cfenv.html" title="cpp/header/cfenv"><tt>&lt;cfenv&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="cmath.html" title="cpp/header/cmath"><tt>&lt;cmath&gt;</tt></a></td></tr>
</table></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> 输入/输出</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="iosfwd.html" title="cpp/header/iosfwd"><tt>&lt;iosfwd&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="ios.html" title="cpp/header/ios"><tt>&lt;ios&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="iomanip.html" title="cpp/header/iomanip"><tt>&lt;iomanip&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="streambuf.html" title="cpp/header/streambuf"><tt>&lt;streambuf&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="istream.html" title="cpp/header/istream"><tt>&lt;istream&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="ostream.html" title="cpp/header/ostream"><tt>&lt;ostream&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="iostream.html" title="cpp/header/iostream"><tt>&lt;iostream&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <br>
</td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="sstream.html" title="cpp/header/sstream"><tt>&lt;sstream&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="spanstream.html" title="cpp/header/spanstream"><tt>&lt;spanstream&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="fstream.html" title="cpp/header/fstream"><tt>&lt;fstream&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="syncstream.html" title="cpp/header/syncstream"><tt>&lt;syncstream&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="cstdio.html" title="cpp/header/cstdio"><tt>&lt;cstdio&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="cinttypes.html" title="cpp/header/cinttypes"><tt>&lt;cinttypes&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="strstream.html" title="cpp/header/strstream"><tt>&lt;strstream&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <br>
</td></tr>
</table></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> 正则表达式</td></tr>
<tr class="t-nv"><td colspan="5"> <a href="regex.html" title="cpp/header/regex"><tt>&lt;regex&gt;</tt></a></td></tr>
<tr class="t-nv-h2"><td colspan="5"> 文件系统</td></tr>
<tr class="t-nv"><td colspan="5"> <a href="filesystem.html" title="cpp/header/filesystem"><tt>&lt;filesystem&gt;</tt></a></td></tr>
<tr class="t-nv-h2"><td colspan="5"> 线程支持</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="thread.html" title="cpp/header/thread"><tt>&lt;thread&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="atomic.html" title="cpp/header/atomic"><tt>&lt;atomic&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="mutex.html" title="cpp/header/mutex"><tt>&lt;mutex&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="shared_mutex.html" title="cpp/header/shared mutex"><tt>&lt;shared_mutex&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="condition_variable.html" title="cpp/header/condition variable"><tt>&lt;condition_variable&gt;</tt></a>    </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="future.html" title="cpp/header/future"><tt>&lt;future&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="stop_token.html" title="cpp/header/stop token"><tt>&lt;stop_token&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="semaphore.html" title="cpp/header/semaphore"><tt>&lt;semaphore&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <br>
</td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="latch.html" title="cpp/header/latch"><tt>&lt;latch&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="barrier.html" title="cpp/header/barrier"><tt>&lt;barrier&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <br>
</td></tr>
</table></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> C 兼容</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="ciso646.html" title="cpp/header/ciso646"><tt>&lt;ciso646&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="cstdalign.html" title="cpp/header/cstdalign"><tt>&lt;cstdalign&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="cstdbool.html" title="cpp/header/cstdbool"><tt>&lt;cstdbool&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="ccomplex.html" title="cpp/header/ccomplex"><tt>&lt;ccomplex&gt;</tt></a></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em">
<tr class="t-nv"><td colspan="5"> <a href="ctgmath.html" title="cpp/header/ctgmath"><tt>&lt;ctgmath&gt;</tt></a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="stdatomic.h.html" title="cpp/header/stdatomic.h"><tt>&lt;stdatomic.h&gt;</tt></a></td></tr>
</table></div></td></tr>
</table></div><div></div></div></div></div><div class="t-navbar-sep"> </div></div>
<p>此头文件是<a href="../ranges.html" title="cpp/ranges">范围</a>库的一部分。
</p>
<h3><span class="mw-headline" id=".E5.91.BD.E5.90.8D.E7.A9.BA.E9.97.B4.E5.88.AB.E5.90.8D"> 命名空间别名 </span></h3>
<table class="t-dcl-begin"><tbody>

<tr class="t-dcl">
<td class="t-dcl-nopad"> <div><span class="mw-geshi cpp source-cpp"><span class="kw1">namespace</span> std <span class="br0">{</span><br>
<p>    <span class="kw1">namespace</span> views <span class="sy1">=</span> ranges<span class="sy4">::</span><span class="me2">views</span><span class="sy4">;</span><br>
</p>
<span class="br0">}</span></span></div></td>
<td class="t-dcl-nopad">  </td>
<td class="t-dcl-nopad">  </td>
</tr>
<tr class="t-dcl-sep"><td></td><td></td><td></td></tr>
</tbody></table>
<p>提供命名空间别名 <code>std::views</code>，作为 <code>std::ranges::views</code> 的简称。
</p>
<table class="t-dsc-begin">

<tr>
<td colspan="2"> <h3> <span class="mw-headline" id=".E6.A6.82.E5.BF.B5"> 概念</span></h3>
</td></tr>

<tr>
<td colspan="2"> <h5> <span class="mw-headline" id=".E8.8C.83.E5.9B.B4.E6.A6.82.E5.BF.B5">  范围概念 </span></h5>
</td></tr>

<tr class="t-dsc-header">
<td colspan="2"> <div>定义于命名空间 <code>std::ranges</code></div>
</td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/range.html" title="cpp/ranges/range"> <span class="t-lines"><span>ranges::range</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  指定类型为范围，即它同时提供 <code>begin</code> 迭代器和 <code>end</code> 哨位 <br> <span class="t-mark">(概念)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/sized_range.html" title="cpp/ranges/sized range"> <span class="t-lines"><span>ranges::sized_range</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  指定范围可在常数时间内知晓其大小 <br> <span class="t-mark">(概念)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/view.html" title="cpp/ranges/view"> <span class="t-lines"><span>ranges::view</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  指定范围为视图，即它拥有常数时间的复制/移动/赋值 <br> <span class="t-mark">(概念)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/input_range.html" title="cpp/ranges/input range"> <span class="t-lines"><span>ranges::input_range</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  指定范围的迭代器类型满足 <a href="../iterator/input_iterator.html" title="cpp/iterator/input iterator"><code>input_iterator</code></a> <br> <span class="t-mark">(概念)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/output_range.html" title="cpp/ranges/output range"> <span class="t-lines"><span>ranges::output_range</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   指定范围的迭代器类型满足 <a href="../iterator/output_iterator.html" title="cpp/iterator/output iterator"><code>output_iterator</code></a> <br> <span class="t-mark">(概念)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/forward_range.html" title="cpp/ranges/forward range"> <span class="t-lines"><span>ranges::forward_range</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   指定范围的迭代器类型满足 <a href="../iterator/forward_iterator.html" title="cpp/iterator/forward iterator"><code>forward_iterator</code></a> <br> <span class="t-mark">(概念)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/bidirectional_range.html" title="cpp/ranges/bidirectional range"> <span class="t-lines"><span>ranges::bidirectional_range</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   指定范围的迭代器类型满足 <a href="../iterator/bidirectional_iterator.html" title="cpp/iterator/bidirectional iterator"><code>bidirectional_iterator</code></a> <br> <span class="t-mark">(概念)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/random_access_range.html" title="cpp/ranges/random access range"> <span class="t-lines"><span>ranges::random_access_range</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   指定范围的迭代器类型满足 <a href="../iterator/random_access_iterator.html" title="cpp/iterator/random access iterator"><code>random_access_iterator</code></a> <br> <span class="t-mark">(概念)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/contiguous_range.html" title="cpp/ranges/contiguous range"> <span class="t-lines"><span>ranges::contiguous_range</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   指定范围的迭代器类型满足 <a href="../iterator/contiguous_iterator.html" title="cpp/iterator/contiguous iterator"><code>contiguous_iterator</code></a> <br> <span class="t-mark">(概念)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/common_range.html" title="cpp/ranges/common range"> <span class="t-lines"><span>ranges::common_range</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  指定范围拥有相同的迭代器和哨位类型 <br> <span class="t-mark">(概念)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/viewable_range.html" title="cpp/ranges/viewable range"> <span class="t-lines"><span>ranges::viewable_range</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  指定针对 <a href="../ranges/range.html" title="cpp/ranges/range"><code>range</code></a> 的要求，令其可安全转换为 <a href="../ranges/view.html" title="cpp/ranges/view"><code>view</code></a> <br> <span class="t-mark">(概念)</span> </td></tr>


<tr>
<td colspan="2"> <h3> <span class="mw-headline" id=".E7.B1.BB"> 类</span></h3>
</td></tr>

<tr>
<td colspan="2"> <h5> <span class="mw-headline" id=".E8.8C.83.E5.9B.B4.E5.8E.9F.E8.AF.AD">  范围原语 </span></h5>
</td></tr>

<tr class="t-dsc-header">
<td colspan="2"> <div>定义于命名空间 <code>std::ranges</code></div>
</td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/iterator_t.html" title="cpp/ranges/iterator t"> <span class="t-lines"><span>ranges::iterator_t</span><span>ranges::sentinel_t</span><span>ranges::range_difference_t</span><span>ranges::range_size_t</span><span>ranges::range_value_t</span><span>ranges::range_reference_t</span><span>ranges::range_rvalue_reference_t</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  获得范围的关联类型 <br> <span class="t-mark">(别名模板)</span> </td></tr>

<tr>
<td colspan="2"> <h5> <span class="mw-headline" id=".E8.A7.86.E5.9B.BE">  视图 </span></h5>
</td></tr>

<tr class="t-dsc-header">
<td colspan="2"> <div>定义于命名空间 <code>std::ranges</code></div>
</td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/view_interface.html" title="cpp/ranges/view interface"> <span class="t-lines"><span>ranges::view_interface</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  用于定义 <a href="../ranges/view.html" title="cpp/ranges/view"><code>view</code></a> 的辅助类模板，使用奇异递归模板模式 <br> <span class="t-mark">(类模板)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/subrange.html" title="cpp/ranges/subrange"> <span class="t-lines"><span>ranges::subrange</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  将迭代器/哨位对结合为一个 <a href="../ranges/view.html" title="cpp/ranges/view"><code>view</code></a> <br> <span class="t-mark">(类模板)</span> </td></tr>

<tr>
<td colspan="2"> <h5> <span class="mw-headline" id=".E6.82.AC.E5.9E.82.E8.BF.AD.E4.BB.A3.E5.99.A8.E5.A4.84.E7.90.86">  悬垂迭代器处理 </span></h5>
</td></tr>

<tr class="t-dsc-header">
<td colspan="2"> <div>定义于命名空间 <code>std::ranges</code></div>
</td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/dangling.html" title="cpp/ranges/dangling"> <span class="t-lines"><span>ranges::dangling</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  占位类型，指示不应返回迭代器或子范围，因为它可能悬垂 <br> <span class="t-mark">(类)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/borrowed_iterator_t.html" title="cpp/ranges/borrowed iterator t"> <span class="t-lines"><span>ranges::borrowed_iterator_t</span><span>ranges::borrowed_subrange_t</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   获得塑造 <a href="../ranges/borrowed_range.html" title="cpp/ranges/borrowed range"><code>borrowed_range</code></a> 的迭代器类型或子范围类型 <br> <span class="t-mark">(别名模板)</span> </td></tr>

<tr>
<td colspan="2"> <h5> <span class="mw-headline" id=".E5.B7.A5.E5.8E.82">  工厂 </span></h5>
</td></tr>

<tr class="t-dsc-header">
<td colspan="2"> <div>定义于命名空间 <code>std::ranges</code></div>
</td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/empty_view.html" title="cpp/ranges/empty view"> <span class="t-lines"><span>ranges::empty_view</span><span>views::empty</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  无元素的空 <a href="../ranges/view.html" title="cpp/ranges/view"><code>view</code></a> <br> <span class="t-mark">(类模板)</span> <span class="t-mark">(变量模板)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/single_view.html" title="cpp/ranges/single view"> <span class="t-lines"><span>ranges::single_view</span><span>views::single</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  含有具有指定值的单个元素的 <a href="../ranges/view.html" title="cpp/ranges/view"><code>view</code></a> <br> <span class="t-mark">(类模板)</span> <span class="t-mark">(定制点对象)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/iota_view.html" title="cpp/ranges/iota view"> <span class="t-lines"><span>ranges::iota_view</span><span>views::iota</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  由通过重复对某个初值自增所生成的序列组成的 <a href="../ranges/view.html" title="cpp/ranges/view"><code>view</code></a> <br> <span class="t-mark">(类模板)</span> <span class="t-mark">(定制点对象)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/view_counted.html" title="cpp/ranges/view counted"> <span class="t-lines"><span>views::counted</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  从迭代器和计数创建子范围 <br> <span class="t-mark">(定制点对象)</span> </td></tr>

<tr>
<td colspan="2"> <h5> <span class="mw-headline" id=".E9.80.82.E9.85.8D.E5.99.A8">  适配器 </span></h5>
</td></tr>

<tr class="t-dsc-header">
<td colspan="2"> <div>定义于命名空间 <code>std::ranges</code></div>
</td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/all_view.html" title="cpp/ranges/all view"> <span class="t-lines"><span>views::all_t</span><span>views::all</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  包含 <a href="../ranges/range.html" title="cpp/ranges/range"><code>range</code></a> 的所有元素的 <a href="../ranges/view.html" title="cpp/ranges/view"><code>view</code></a> <br> <span class="t-mark">(别名模板)</span> <span class="t-mark">(范围适配器对象)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/ref_view.html" title="cpp/ranges/ref view"> <span class="t-lines"><span>ranges::ref_view</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  某个其他 <a href="../ranges/range.html" title="cpp/ranges/range"><code>range</code></a> 的元素的 <a href="../ranges/view.html" title="cpp/ranges/view"><code>view</code></a> <br> <span class="t-mark">(类模板)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/filter_view.html" title="cpp/ranges/filter view"> <span class="t-lines"><span>ranges::filter_view</span><span>views::filter</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  由 <a href="../ranges/range.html" title="cpp/ranges/range"><code>range</code></a> 中满足某个谓词的元素构成的 <a href="../ranges/view.html" title="cpp/ranges/view"><code>view</code></a> <br> <span class="t-mark">(类模板)</span> <span class="t-mark">(范围适配器对象)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/transform_view.html" title="cpp/ranges/transform view"> <span class="t-lines"><span>ranges::transform_view</span><span>views::transform</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  对序列的每个元素应用某个变换函数的 <a href="../ranges/view.html" title="cpp/ranges/view"><code>view</code></a> <br> <span class="t-mark">(类模板)</span> <span class="t-mark">(范围适配器对象)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/take_view.html" title="cpp/ranges/take view"> <span class="t-lines"><span>ranges::take_view</span><span>views::take</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  由另一 <a href="../ranges/view.html" title="cpp/ranges/view"><code>view</code></a> 的前 N 个元素组成的 <a href="../ranges/view.html" title="cpp/ranges/view"><code>view</code></a> <br> <span class="t-mark">(类模板)</span> <span class="t-mark">(范围适配器对象)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/join_view.html" title="cpp/ranges/join view"> <span class="t-lines"><span>ranges::join_view</span><span>views::join</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  由拉平 <a href="../ranges/range.html" title="cpp/ranges/range"><code>range</code></a> 的 <a href="../ranges/view.html" title="cpp/ranges/view"><code>view</code></a> 所获得的序列构成的 <a href="../ranges/view.html" title="cpp/ranges/view"><code>view</code></a> <br> <span class="t-mark">(类模板)</span> <span class="t-mark">(范围适配器对象)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="https://zh.cppreference.com/mwiki/index.php?title=cpp/ranges/split_view&amp;action=edit&amp;redlink=1" class="new" title="cpp/ranges/split view（页面不存在）"> <span class="t-lines"><span>ranges::split_view</span><span>views::split</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  用某个分隔符切割另一 <a href="../ranges/view.html" title="cpp/ranges/view"><code>view</code></a> 所获得的子范围的 <a href="../ranges/view.html" title="cpp/ranges/view"><code>view</code></a>  <br> <span class="t-mark">(类模板)</span> <span class="t-mark">(范围适配器对象)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/common_view.html" title="cpp/ranges/common view"> <span class="t-lines"><span>ranges::common_view</span><span>views::common</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  转换 <a href="../ranges/view.html" title="cpp/ranges/view"><code>view</code></a> 为 <a href="../ranges/common_range.html" title="cpp/ranges/common range"><code>common_range</code></a>  <br> <span class="t-mark">(类模板)</span> <span class="t-mark">(范围适配器对象)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/reverse_view.html" title="cpp/ranges/reverse view"> <span class="t-lines"><span>ranges::reverse_view</span><span>views::reverse</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  以逆序迭代另一双向视图上的元素的 <a href="../ranges/view.html" title="cpp/ranges/view"><code>view</code></a> <br> <span class="t-mark">(类模板)</span> <span class="t-mark">(范围适配器对象)</span> </td></tr>


<tr>
<td colspan="2"> <h3> <span class="mw-headline" id=".E5.AE.9A.E5.88.B6.E7.82.B9.E5.AF.B9.E8.B1.A1"> 定制点对象</span></h3>
</td></tr>

<tr>
<td colspan="2"> <h5> <span class="mw-headline" id=".E8.8C.83.E5.9B.B4.E8.AE.BF.E9.97.AE">  范围访问 </span></h5>
</td></tr>

<tr class="t-dsc-header">
<td colspan="2"> <div>定义于命名空间 <code>std::ranges</code></div>
</td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/begin.html" title="cpp/ranges/begin"> <span class="t-lines"><span>ranges::begin</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  返回指向范围起始的迭代器 <br> <span class="t-mark">(定制点对象)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/end.html" title="cpp/ranges/end"> <span class="t-lines"><span>ranges::end</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  返回指示范围结尾的哨位  <br> <span class="t-mark">(定制点对象)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/rbegin.html" title="cpp/ranges/rbegin"> <span class="t-lines"><span>ranges::rbegin</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  返回指向范围的逆向迭代器 <br> <span class="t-mark">(定制点对象)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/rend.html" title="cpp/ranges/rend"> <span class="t-lines"><span>ranges::rend</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  返回指向范围的逆向尾迭代器 <br> <span class="t-mark">(定制点对象)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/size.html" title="cpp/ranges/size"> <span class="t-lines"><span>ranges::size</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  返回等于范围大小的整数 <br> <span class="t-mark">(定制点对象)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/empty.html" title="cpp/ranges/empty"> <span class="t-lines"><span>ranges::empty</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>   检查范围是否为空 <br> <span class="t-mark">(定制点对象)</span> </td></tr>

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../ranges/data.html" title="cpp/ranges/data"> <span class="t-lines"><span>ranges::data</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  获得指向连续范围的起始的指针 <br> <span class="t-mark">(定制点对象)</span> </td></tr>
</table>
<h3><span class="mw-headline" id=".E6.A6.82.E8.A6.81">概要</span></h3>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="co2">#include &lt;initializer_list&gt;</span>
<span class="co2">#include &lt;iterator&gt;</span>
 
<span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">inline</span> <span class="kw1">namespace</span> <span class="coMULTI">/* 未指明 */</span> <span class="br0">{</span>
    <span class="co1">// 范围访问</span>
    <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> begin <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span>
    <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> end <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span>
    <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> cbegin <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span>
    <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> cend <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span>
    <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> rbegin <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span>
    <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> rend <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span>
    <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> crbegin <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span>
    <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> crend <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span>
 
    <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> size <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span>
    <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> empty <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span>
    <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> data <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span>
    <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> cdata <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span>
  <span class="br0">}</span>
 
  <span class="co1">// 范围</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    <span class="kw1">using</span> iterator_t <span class="sy1">=</span> decltype<span class="br0">(</span>ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>declval<span class="sy1">&lt;</span>T<span class="sy3">&amp;</span><span class="sy1">&gt;</span><span class="br0">(</span><span class="br0">)</span><span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    <span class="kw1">using</span> sentinel_t <span class="sy1">=</span> decltype<span class="br0">(</span>ranges<span class="sy4">::</span><span class="me2">end</span><span class="br0">(</span>declval<span class="sy1">&lt;</span>T<span class="sy3">&amp;</span><span class="sy1">&gt;</span><span class="br0">(</span><span class="br0">)</span><span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept Range <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
 
  <span class="co1">// 有大小范围</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span><span class="sy1">&gt;</span>
    <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> disable_sized_range <span class="sy1">=</span> <span class="kw2">false</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept SizedRange <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
 
  <span class="co1">// 视图</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> enable_view <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
 
  <span class="kw1">struct</span> view_base <span class="br0">{</span> <span class="br0">}</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept View <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
 
  <span class="co1">// 其他范围细化</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> R, <span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept OutputRange <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept InputRange <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept ForwardRange <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept BidirectionalRange <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept RandomAccessRange <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept ContiguousRange <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept CommonRange <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept ViewableRange <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
 
  <span class="co1">// 类模板 view_interface</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> D<span class="sy1">&gt;</span>
    requires is_class_v<span class="sy1">&lt;</span>D<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> Same<span class="sy1">&lt;</span>D, remove_cv_t<span class="sy1">&lt;</span>D<span class="sy1">&gt;&gt;</span>
  <span class="kw1">class</span> view_interface<span class="sy4">;</span>
 
  <span class="co1">// 子范围</span>
  <span class="kw2">enum</span> <span class="kw1">class</span> subrange_kind <span class="sy4">:</span> <span class="kw4">bool</span> <span class="br0">{</span> unsized, sized <span class="br0">}</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span>Iterator I, Sentinel<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span> S <span class="sy1">=</span> I, subrange_kind K <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy1">&gt;</span>
    requires <span class="br0">(</span>K <span class="sy1">==</span> subrange_kind<span class="sy4">::</span><span class="me2">sized</span> <span class="sy3">||</span> <span class="sy3">!</span>SizedSentinel<span class="sy1">&lt;</span>S, I<span class="sy1">&gt;</span><span class="br0">)</span>
  <span class="kw1">class</span> subrange<span class="sy4">;</span>
 
  <span class="co1">// 悬垂迭代器处理</span>
  <span class="kw1">struct</span> dangling<span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span>Range R<span class="sy1">&gt;</span>
    <span class="kw1">using</span> safe_iterator_t <span class="sy1">=</span> conditional_t<span class="sy1">&lt;</span>__ForwardingRange<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>, iterator_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>, dangling<span class="sy1">&gt;</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span>Range R<span class="sy1">&gt;</span>
    <span class="kw1">using</span> safe_subrange_t <span class="sy1">=</span>
      conditional_t<span class="sy1">&lt;</span>__ForwardingRange<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>, subrange<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span>, dangling<span class="sy1">&gt;</span><span class="sy4">;</span>
 
  <span class="co1">// 空视图</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    requires is_object_v<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span>
  <span class="kw1">class</span> empty_view<span class="sy4">;</span>
 
  <span class="kw1">namespace</span> view <span class="br0">{</span>
    <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
      <span class="kw1">inline</span> <span class="kw4">constexpr</span> empty_view<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span> empty<span class="br0">{</span><span class="br0">}</span><span class="sy4">;</span>
  <span class="br0">}</span>
 
  <span class="co1">// 单体视图</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span>CopyConstructible T<span class="sy1">&gt;</span>
    requires is_object_v<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span>
  <span class="kw1">class</span> single_view<span class="sy4">;</span>
 
  <span class="kw1">namespace</span> view <span class="br0">{</span> <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> single <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span> <span class="br0">}</span>
 
  <span class="co1">// iota 视图</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span>WeaklyIncrementable W, Semiregular Bound <span class="sy1">=</span> unreachable_sentinel_t<span class="sy1">&gt;</span>
    requires __WeaklyEqualityComparableWith<span class="sy1">&lt;</span>W, Bound<span class="sy1">&gt;</span>
  <span class="kw1">class</span> iota_view<span class="sy4">;</span>
 
  <span class="kw1">namespace</span> view <span class="br0">{</span> <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> iota <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span> <span class="br0">}</span>
 
  <span class="co1">// 全视图</span>
  <span class="kw1">namespace</span> view <span class="br0">{</span> <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> all <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span> <span class="br0">}</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span>ViewableRange R<span class="sy1">&gt;</span>
    <span class="kw1">using</span> all_view <span class="sy1">=</span> decltype<span class="br0">(</span>view<span class="sy4">::</span><span class="me2">all</span><span class="br0">(</span>declval<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span><span class="br0">(</span><span class="br0">)</span><span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span>Range R<span class="sy1">&gt;</span>
    requires is_object_v<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>
  <span class="kw1">class</span> ref_view<span class="sy4">;</span>
 
  <span class="co1">// 过滤视图</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span>InputRange V, IndirectUnaryPredicate<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span> Pred<span class="sy1">&gt;</span>
    requires View<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> is_object_v<span class="sy1">&lt;</span>Pred<span class="sy1">&gt;</span>
  <span class="kw1">class</span> filter_view<span class="sy4">;</span>
 
  <span class="kw1">namespace</span> view <span class="br0">{</span> <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> filter <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span> <span class="br0">}</span>
 
  <span class="co1">// 变换视图</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span>InputRange V, CopyConstructible F<span class="sy1">&gt;</span>
    requires View<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> is_object_v<span class="sy1">&lt;</span>F<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
             RegularInvocable<span class="sy1">&lt;</span>F<span class="sy3">&amp;</span>, iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;&gt;</span>
  <span class="kw1">class</span> transform_view<span class="sy4">;</span>
 
  <span class="kw1">namespace</span> view <span class="br0">{</span> <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> transform <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span> <span class="br0">}</span>
 
  <span class="co1">// 取部分视图</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span>View<span class="sy1">&gt;</span> <span class="kw1">class</span> take_view<span class="sy4">;</span>
 
  <span class="kw1">namespace</span> view <span class="br0">{</span> <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> take <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span> <span class="br0">}</span>
 
  <span class="co1">// 连接视图</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span>InputRange V<span class="sy1">&gt;</span>
    requires View<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> InputRange<span class="sy1">&lt;</span>iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;&gt;</span> <span class="sy3">&amp;&amp;</span>
             <span class="br0">(</span>is_reference_v<span class="sy1">&lt;</span>iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;&gt;</span> <span class="sy3">||</span>
              View<span class="sy1">&lt;</span>iter_value_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;&gt;</span><span class="br0">)</span>
  <span class="kw1">class</span> join_view<span class="sy4">;</span>
 
  <span class="kw1">namespace</span> view <span class="br0">{</span> <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> join <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span> <span class="br0">}</span>
 
  <span class="co1">// 分割视图</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> R<span class="sy1">&gt;</span>
    concept __TinyRange <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>   <span class="co1">// 仅用于阐释</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span>InputRange V, ForwardRange Pattern<span class="sy1">&gt;</span>
    requires View<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> View<span class="sy1">&lt;</span>Pattern<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
             IndirectlyComparable<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span>, iterator_t<span class="sy1">&lt;</span>Pattern<span class="sy1">&gt;</span>, ranges<span class="sy4">::</span><span class="me2">equal_to</span><span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
             <span class="br0">(</span>ForwardRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="sy3">||</span> __TinyRange<span class="sy1">&lt;</span>Pattern<span class="sy1">&gt;</span><span class="br0">)</span>
  <span class="kw1">class</span> split_view<span class="sy4">;</span>
 
  <span class="kw1">namespace</span> view <span class="br0">{</span> <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> split <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span> <span class="br0">}</span>
 
  <span class="co1">// 计数视图</span>
  <span class="kw1">namespace</span> view <span class="br0">{</span> <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> counted <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span> <span class="br0">}</span>
 
  <span class="co1">// 公共视图</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span>View V<span class="sy1">&gt;</span>
    requires <span class="br0">(</span><span class="sy3">!</span>CommonRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="br0">)</span>
  <span class="kw1">class</span> common_view<span class="sy4">;</span>
 
  <span class="kw1">namespace</span> view <span class="br0">{</span> <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> common <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span> <span class="br0">}</span>
 
  <span class="co1">// 逆向视图</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span>View V<span class="sy1">&gt;</span>
    requires BidirectionalRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span>
  <span class="kw1">class</span> reverse_view<span class="sy4">;</span>
 
  <span class="kw1">namespace</span> view <span class="br0">{</span> <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="coMULTI">/* 未指明 */</span> reverse <span class="sy1">=</span> <span class="coMULTI">/* 未指明 */</span><span class="sy4">;</span> <span class="br0">}</span>
<span class="br0">}</span>
 
<span class="kw1">namespace</span> std <span class="br0">{</span>
  <span class="kw1">namespace</span> view <span class="sy1">=</span> ranges<span class="sy4">::</span><span class="me2">view</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> I, <span class="kw1">class</span> S, ranges<span class="sy4">::</span><span class="me2">subrange_kind</span> K<span class="sy1">&gt;</span>
  <span class="kw1">struct</span> tuple_size<span class="sy1">&lt;</span>ranges<span class="sy4">::</span><span class="me2">subrange</span><span class="sy1">&lt;</span>I, S, K<span class="sy1">&gt;&gt;</span>
    <span class="sy4">:</span> integral_constant<span class="sy1">&lt;</span>size_t, <span class="nu0">2</span><span class="sy1">&gt;</span> <span class="br0">{</span><span class="br0">}</span><span class="sy4">;</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> I, <span class="kw1">class</span> S, ranges<span class="sy4">::</span><span class="me2">subrange_kind</span> K<span class="sy1">&gt;</span>
  <span class="kw1">struct</span> tuple_element<span class="sy1">&lt;</span><span class="nu0">0</span>, ranges<span class="sy4">::</span><span class="me2">subrange</span><span class="sy1">&lt;</span>I, S, K<span class="sy1">&gt;&gt;</span> <span class="br0">{</span>
    <span class="kw1">using</span> type <span class="sy1">=</span> I<span class="sy4">;</span>
  <span class="br0">}</span><span class="sy4">;</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> I, <span class="kw1">class</span> S, ranges<span class="sy4">::</span><span class="me2">subrange_kind</span> K<span class="sy1">&gt;</span>
  <span class="kw1">struct</span> tuple_element<span class="sy1">&lt;</span><span class="nu0">1</span>, ranges<span class="sy4">::</span><span class="me2">subrange</span><span class="sy1">&lt;</span>I, S, K<span class="sy1">&gt;&gt;</span> <span class="br0">{</span>
    <span class="kw1">using</span> type <span class="sy1">=</span> S<span class="sy4">;</span>
  <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E6.A6.82.E5.BF.B5_range">概念 <a href="../ranges/range.html" title="cpp/ranges/range"><code>range</code></a></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span> <span class="kw1">class</span> T <span class="sy1">&gt;</span>
    concept range <span class="sy1">=</span> requires<span class="br0">(</span>T<span class="sy3">&amp;</span> t<span class="br0">)</span> <span class="br0">{</span>
      ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>t<span class="br0">)</span><span class="sy4">;</span> <span class="co1">// 对向前迭代器保持相等性</span>
      ranges<span class="sy4">::</span><span class="me2">end</span><span class="br0">(</span>t<span class="br0">)</span><span class="sy4">;</span>
  <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E6.A6.82.E5.BF.B5_sized_range">概念 <a href="../ranges/sized_range.html" title="cpp/ranges/sized range"><code>sized_range</code></a></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span> <span class="kw1">class</span> T <span class="sy1">&gt;</span>
    concept sized_range <span class="sy1">=</span> range<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
      requires<span class="br0">(</span>T<span class="sy3">&amp;</span> t<span class="br0">)</span> <span class="br0">{</span>
        ranges<span class="sy4">::</span><span class="me2">size</span><span class="br0">(</span>t<span class="br0">)</span><span class="sy4">;</span>
      <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E6.A6.82.E5.BF.B5_view">概念 <a href="../ranges/view.html" title="cpp/ranges/view"><code>view</code></a></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    <span class="kw1">inline</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> enable_view <span class="sy1">=</span> derived_from<span class="sy1">&lt;</span>T, view_base<span class="sy1">&gt;</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept view <span class="sy1">=</span> range<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span>
                <span class="sy3">&amp;&amp;</span> movable<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span>
                <span class="sy3">&amp;&amp;</span> default_initializable<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span>
                <span class="sy3">&amp;&amp;</span> enable_view<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E6.A6.82.E5.BF.B5_output_range">概念 <a href="../ranges/output_range.html" title="cpp/ranges/output range"><code>output_range</code></a></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> R, <span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept output_range <span class="sy1">=</span>
      range<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> output_iterator<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>, T<span class="sy1">&gt;</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E6.A6.82.E5.BF.B5_input_range">概念 <a href="../ranges/input_range.html" title="cpp/ranges/input range"><code>input_range</code></a></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept input_range <span class="sy1">=</span>
      range<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> input_iterator<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>T<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E6.A6.82.E5.BF.B5_forward_range">概念 <a href="../ranges/forward_range.html" title="cpp/ranges/forward range"><code>forward_range</code></a></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept forward_range <span class="sy1">=</span>
      input_range<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> forward_iterator<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>T<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E6.A6.82.E5.BF.B5_bidirectional_range">概念 <a href="../ranges/bidirectional_range.html" title="cpp/ranges/bidirectional range"><code>bidirectional_range</code></a></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept bidirectional_range <span class="sy1">=</span>
      forward_range<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> bidirectional_iterator<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>T<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E6.A6.82.E5.BF.B5_random_access_range">概念 <a href="../ranges/random_access_range.html" title="cpp/ranges/random access range"><code>random_access_range</code></a></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept random_access_range <span class="sy1">=</span>
      bidirectional_range<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> random_access_iterator<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>T<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E6.A6.82.E5.BF.B5_contiguous_range">概念 <a href="../ranges/contiguous_range.html" title="cpp/ranges/contiguous range"><code>contiguous_range</code></a></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept contiguous_range <span class="sy1">=</span>
      random_access_range<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> contiguous_iterator<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>T<span class="sy1">&gt;&gt;</span> <span class="sy3">&amp;&amp;</span>
        requires<span class="br0">(</span>T<span class="sy3">&amp;</span> t<span class="br0">)</span> <span class="br0">{</span>
          <span class="br0">{</span> ranges<span class="sy4">::</span><span class="me2">data</span><span class="br0">(</span>t<span class="br0">)</span> <span class="br0">}</span> <span class="sy2">-</span><span class="sy1">&gt;</span> same_as<span class="sy1">&lt;</span>add_pointer_t<span class="sy1">&lt;</span>range_reference_t<span class="sy1">&lt;</span>T<span class="sy1">&gt;&gt;&gt;</span><span class="sy4">;</span>
        <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E6.A6.82.E5.BF.B5_common_range">概念 <a href="../ranges/common_range.html" title="cpp/ranges/common range"><code>common_range</code></a></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept common_range <span class="sy1">=</span>
      range<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> same_as<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span>, sentinel_t<span class="sy1">&lt;</span>T<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E6.A6.82.E5.BF.B5_viewable_range">概念 <a href="../ranges/viewable_range.html" title="cpp/ranges/viewable range"><code>viewable_range</code></a></span></h4>
<p>{{source|1=
namespace std::ranges {
</p>
<pre> template&lt;class T&gt;
   concept viewable_range =
     range&lt;T&gt; &amp;&amp; (borrowed_range&lt;T&gt; || view&lt;remove_cvref_t&lt;T&gt;&gt;);
</pre>
<p>}
</p>
<h4><span class="mw-headline" id=".E8.BE.85.E5.8A.A9.E6.A6.82.E5.BF.B5">辅助概念</span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span> <span class="co1">// 未指定，仅用于名字查找</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> R<span class="sy1">&gt;</span>
    concept __SimpleView <span class="sy1">=</span>                        <span class="co1">// 仅用于阐释</span>
      View<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> Range<span class="sy1">&lt;</span><span class="kw4">const</span> R<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
      Same<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>, iterator_t<span class="sy1">&lt;</span><span class="kw4">const</span> R<span class="sy1">&gt;&gt;</span> <span class="sy3">&amp;&amp;</span>
      Same<span class="sy1">&lt;</span>sentinel_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>, sentinel_t<span class="sy1">&lt;</span><span class="kw4">const</span> R<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span>InputIterator I<span class="sy1">&gt;</span>
    concept __HasArrow <span class="sy1">=</span>                          <span class="co1">// 仅用于阐释</span>
      is_pointer_v<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span> <span class="sy3">||</span> requires<span class="br0">(</span>I i<span class="br0">)</span> <span class="br0">{</span> i.<span class="me1">operator</span><span class="sy2">-</span><span class="sy1">&gt;</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span> <span class="br0">}</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T, <span class="kw1">class</span> U<span class="sy1">&gt;</span>
    concept __NotSameAs <span class="sy1">=</span>                         <span class="co1">// 仅用于阐释</span>
      <span class="sy3">!</span>Same<span class="sy1">&lt;</span>remove_cvref_t<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span>, remove_cvref_t<span class="sy1">&lt;</span>U<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> I<span class="sy1">&gt;</span>
    concept _Decrementable <span class="sy1">=</span>                      <span class="co1">// 仅用于阐释</span>
      Incrementable<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> requires<span class="br0">(</span>I i<span class="br0">)</span> <span class="br0">{</span>
        <span class="br0">{</span> <span class="sy2">--</span>i <span class="br0">}</span> <span class="sy2">-</span><span class="sy1">&gt;</span> Same<span class="sy1">&lt;</span>I<span class="sy3">&amp;</span><span class="sy1">&gt;</span><span class="sy4">;</span>
        <span class="br0">{</span> i<span class="sy2">--</span> <span class="br0">}</span> <span class="sy2">-</span><span class="sy1">&gt;</span> Same<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span><span class="sy4">;</span>
      <span class="br0">}</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> I<span class="sy1">&gt;</span>
    concept _Advanceable <span class="sy1">=</span>                        <span class="co1">// 仅用于阐释</span>
      _Decrementable<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> StrictTotallyOrdered<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
      requires<span class="br0">(</span>I i, <span class="kw4">const</span> I j, <span class="kw4">const</span> iter_difference_t<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span> n<span class="br0">)</span> <span class="br0">{</span>
        <span class="br0">{</span> i <span class="sy2">+</span><span class="sy1">=</span> n <span class="br0">}</span> <span class="sy2">-</span><span class="sy1">&gt;</span> Same<span class="sy1">&lt;</span>I<span class="sy3">&amp;</span><span class="sy1">&gt;</span><span class="sy4">;</span>
        <span class="br0">{</span> i <span class="sy2">-</span><span class="sy1">=</span> n <span class="br0">}</span> <span class="sy2">-</span><span class="sy1">&gt;</span> Same<span class="sy1">&lt;</span>I<span class="sy3">&amp;</span><span class="sy1">&gt;</span><span class="sy4">;</span>
        <span class="br0">{</span> j <span class="sy2">+</span>  n <span class="br0">}</span> <span class="sy2">-</span><span class="sy1">&gt;</span> Same<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span><span class="sy4">;</span>
        <span class="br0">{</span> n <span class="sy2">+</span>  j <span class="br0">}</span> <span class="sy2">-</span><span class="sy1">&gt;</span> Same<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span><span class="sy4">;</span>
        <span class="br0">{</span> j <span class="sy2">-</span>  n <span class="br0">}</span> <span class="sy2">-</span><span class="sy1">&gt;</span> Same<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span><span class="sy4">;</span>
        <span class="br0">{</span> j <span class="sy2">-</span>  j <span class="br0">}</span> <span class="sy2">-</span><span class="sy1">&gt;</span> Same<span class="sy1">&lt;</span>iter_difference_t<span class="sy1">&lt;</span>I<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
      <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<p>注意：这些名字仅用于阐释目的，它们不是接口的一部分。
</p>
<h4><span class="mw-headline" id=".E7.B1.BB.E6.A8.A1.E6.9D.BF_std::ranges::view_interface">类模板 <span class="t-lc">std::ranges::view_interface</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> D<span class="sy1">&gt;</span>
    requires is_class_v<span class="sy1">&lt;</span>D<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> Same<span class="sy1">&lt;</span>D, remove_cv_t<span class="sy1">&lt;</span>D<span class="sy1">&gt;&gt;</span>
  <span class="kw1">class</span> view_interface <span class="sy4">:</span> <span class="kw1">public</span> view_base <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    <span class="kw4">constexpr</span> D<span class="sy3">&amp;</span> derived<span class="br0">(</span><span class="br0">)</span> <span class="kw1">noexcept</span> <span class="br0">{</span>                   <span class="co1">// 仅用于阐释</span>
      <span class="kw1">return</span> <span class="kw1">static_cast</span><span class="sy1">&lt;</span>D<span class="sy3">&amp;</span><span class="sy1">&gt;</span><span class="br0">(</span><span class="sy2">*</span>this<span class="br0">)</span><span class="sy4">;</span>
    <span class="br0">}</span>
    <span class="kw4">constexpr</span> <span class="kw4">const</span> D<span class="sy3">&amp;</span> derived<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> <span class="kw1">noexcept</span> <span class="br0">{</span>       <span class="co1">// 仅用于阐释</span>
      <span class="kw1">return</span> <span class="kw1">static_cast</span><span class="sy1">&lt;</span><span class="kw4">const</span> D<span class="sy3">&amp;</span><span class="sy1">&gt;</span><span class="br0">(</span><span class="sy2">*</span>this<span class="br0">)</span><span class="sy4">;</span>
    <span class="br0">}</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    <span class="kw4">constexpr</span> <span class="kw4">bool</span> empty<span class="br0">(</span><span class="br0">)</span> requires ForwardRange<span class="sy1">&lt;</span>D<span class="sy1">&gt;</span> <span class="br0">{</span>
      <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>derived<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span> <span class="sy1">==</span> ranges<span class="sy4">::</span><span class="me2">end</span><span class="br0">(</span>derived<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="br0">}</span>
    <span class="kw4">constexpr</span> <span class="kw4">bool</span> empty<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> requires ForwardRange<span class="sy1">&lt;</span><span class="kw4">const</span> D<span class="sy1">&gt;</span> <span class="br0">{</span>
      <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>derived<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span> <span class="sy1">==</span> ranges<span class="sy4">::</span><span class="me2">end</span><span class="br0">(</span>derived<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw1">explicit</span> operator <span class="kw4">bool</span><span class="br0">(</span><span class="br0">)</span>
      requires requires <span class="br0">{</span> ranges<span class="sy4">::</span><span class="me2">empty</span><span class="br0">(</span>derived<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span> <span class="br0">}</span> <span class="br0">{</span>
        <span class="kw1">return</span> <span class="sy3">!</span>ranges<span class="sy4">::</span><span class="me2">empty</span><span class="br0">(</span>derived<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span>
      <span class="br0">}</span>
    <span class="kw4">constexpr</span> <span class="kw1">explicit</span> operator <span class="kw4">bool</span><span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span>
      requires requires <span class="br0">{</span> ranges<span class="sy4">::</span><span class="me2">empty</span><span class="br0">(</span>derived<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span> <span class="br0">}</span> <span class="br0">{</span>
        <span class="kw1">return</span> <span class="sy3">!</span>ranges<span class="sy4">::</span><span class="me2">empty</span><span class="br0">(</span>derived<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span>
      <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> data<span class="br0">(</span><span class="br0">)</span> requires ContiguousIterator<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>D<span class="sy1">&gt;&gt;</span> <span class="br0">{</span>
      <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">empty</span><span class="br0">(</span>derived<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span> <span class="sy4">?</span> nullptr <span class="sy4">:</span> addressof<span class="br0">(</span><span class="sy2">*</span>ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>derived<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="br0">}</span>
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> data<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span>
      requires Range<span class="sy1">&lt;</span><span class="kw4">const</span> D<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> ContiguousIterator<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span><span class="kw4">const</span> D<span class="sy1">&gt;&gt;</span> <span class="br0">{</span>
        <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">empty</span><span class="br0">(</span>derived<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span> <span class="sy4">?</span> nullptr <span class="sy4">:</span> addressof<span class="br0">(</span><span class="sy2">*</span>ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>derived<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span>
      <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> size<span class="br0">(</span><span class="br0">)</span> requires ForwardRange<span class="sy1">&lt;</span>D<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
      SizedSentinel<span class="sy1">&lt;</span>sentinel_t<span class="sy1">&lt;</span>D<span class="sy1">&gt;</span>, iterator_t<span class="sy1">&lt;</span>D<span class="sy1">&gt;&gt;</span> <span class="br0">{</span>
        <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">end</span><span class="br0">(</span>derived<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span> <span class="sy2">-</span> ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>derived<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span>
      <span class="br0">}</span>
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> size<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> requires ForwardRange<span class="sy1">&lt;</span><span class="kw4">const</span> D<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
      SizedSentinel<span class="sy1">&lt;</span>sentinel_t<span class="sy1">&lt;</span><span class="kw4">const</span> D<span class="sy1">&gt;</span>, iterator_t<span class="sy1">&lt;</span><span class="kw4">const</span> D<span class="sy1">&gt;&gt;</span> <span class="br0">{</span>
        <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">end</span><span class="br0">(</span>derived<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span> <span class="sy2">-</span> ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>derived<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span>
      <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> decltype<span class="br0">(</span><span class="kw4">auto</span><span class="br0">)</span> front<span class="br0">(</span><span class="br0">)</span> requires ForwardRange<span class="sy1">&lt;</span>D<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> decltype<span class="br0">(</span><span class="kw4">auto</span><span class="br0">)</span> front<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> requires ForwardRange<span class="sy1">&lt;</span><span class="kw4">const</span> D<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> decltype<span class="br0">(</span><span class="kw4">auto</span><span class="br0">)</span> back<span class="br0">(</span><span class="br0">)</span> requires BidirectionalRange<span class="sy1">&lt;</span>D<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> CommonRange<span class="sy1">&lt;</span>D<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> decltype<span class="br0">(</span><span class="kw4">auto</span><span class="br0">)</span> back<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span>
      requires BidirectionalRange<span class="sy1">&lt;</span><span class="kw4">const</span> D<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> CommonRange<span class="sy1">&lt;</span><span class="kw4">const</span> D<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    <span class="kw1">template</span><span class="sy1">&lt;</span>RandomAccessRange R <span class="sy1">=</span> D<span class="sy1">&gt;</span>
      <span class="kw4">constexpr</span> decltype<span class="br0">(</span><span class="kw4">auto</span><span class="br0">)</span> operator<span class="br0">[</span><span class="br0">]</span><span class="br0">(</span>iter_difference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span> n<span class="br0">)</span> <span class="br0">{</span>
        <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>derived<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span><span class="br0">[</span>n<span class="br0">]</span><span class="sy4">;</span>
      <span class="br0">}</span>
    <span class="kw1">template</span><span class="sy1">&lt;</span>RandomAccessRange R <span class="sy1">=</span> <span class="kw4">const</span> D<span class="sy1">&gt;</span>
      <span class="kw4">constexpr</span> decltype<span class="br0">(</span><span class="kw4">auto</span><span class="br0">)</span> operator<span class="br0">[</span><span class="br0">]</span><span class="br0">(</span>iter_difference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span> n<span class="br0">)</span> <span class="kw4">const</span> <span class="br0">{</span>
        <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>derived<span class="br0">(</span><span class="br0">)</span><span class="br0">)</span><span class="br0">[</span>n<span class="br0">]</span><span class="sy4">;</span>
      <span class="br0">}</span>
  <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB.E6.A8.A1.E6.9D.BF_std::ranges::subrange">类模板 <span class="t-lc">std::ranges::subrange</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept __PairLike <span class="sy1">=</span>                                <span class="co1">// 仅用于阐释</span>
      <span class="sy3">!</span>is_reference_v<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> requires<span class="br0">(</span>T t<span class="br0">)</span> <span class="br0">{</span>
        <span class="kw1">typename</span> tuple_size<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">type</span><span class="sy4">;</span>   <span class="co1">// 确保 tuple_­size&lt;T&gt; 完整</span>
        requires DerivedFrom<span class="sy1">&lt;</span>tuple_size<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span>, integral_constant<span class="sy1">&lt;</span>size_t, <span class="nu0">2</span><span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
        <span class="kw1">typename</span> tuple_element_t<span class="sy1">&lt;</span><span class="nu0">0</span>, remove_const_t<span class="sy1">&lt;</span>T<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
        <span class="kw1">typename</span> tuple_element_t<span class="sy1">&lt;</span><span class="nu0">1</span>, remove_const_t<span class="sy1">&lt;</span>T<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
        <span class="br0">{</span> get<span class="sy1">&lt;</span><span class="nu0">0</span><span class="sy1">&gt;</span><span class="br0">(</span>t<span class="br0">)</span> <span class="br0">}</span> <span class="sy2">-</span><span class="sy1">&gt;</span> <span class="kw4">const</span> tuple_element_t<span class="sy1">&lt;</span><span class="nu0">0</span>, T<span class="sy1">&gt;</span><span class="sy3">&amp;</span><span class="sy4">;</span>
        <span class="br0">{</span> get<span class="sy1">&lt;</span><span class="nu0">1</span><span class="sy1">&gt;</span><span class="br0">(</span>t<span class="br0">)</span> <span class="br0">}</span> <span class="sy2">-</span><span class="sy1">&gt;</span> <span class="kw4">const</span> tuple_element_t<span class="sy1">&lt;</span><span class="nu0">1</span>, T<span class="sy1">&gt;</span><span class="sy3">&amp;</span><span class="sy4">;</span>
      <span class="br0">}</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T, <span class="kw1">class</span> U, <span class="kw1">class</span> V<span class="sy1">&gt;</span>
    concept __PairLikeConvertibleTo <span class="sy1">=</span>                   <span class="co1">// 仅用于阐释</span>
      <span class="sy3">!</span>Range<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> __PairLike<span class="sy1">&lt;</span>remove_reference_t<span class="sy1">&lt;</span>T<span class="sy1">&gt;&gt;</span> <span class="sy3">&amp;&amp;</span>
      requires<span class="br0">(</span>T<span class="sy3">&amp;&amp;</span> t<span class="br0">)</span> <span class="br0">{</span>
        <span class="br0">{</span> get<span class="sy1">&lt;</span><span class="nu0">0</span><span class="sy1">&gt;</span><span class="br0">(</span><a href="../utility/forward.html"><span class="kw1117">std::<span class="me2">forward</span></span></a><span class="sy1">&lt;</span>T<span class="sy1">&gt;</span><span class="br0">(</span>t<span class="br0">)</span><span class="br0">)</span> <span class="br0">}</span> <span class="sy2">-</span><span class="sy1">&gt;</span> ConvertibleTo<span class="sy1">&lt;</span>U<span class="sy1">&gt;</span><span class="sy4">;</span>
        <span class="br0">{</span> get<span class="sy1">&lt;</span><span class="nu0">1</span><span class="sy1">&gt;</span><span class="br0">(</span><a href="../utility/forward.html"><span class="kw1117">std::<span class="me2">forward</span></span></a><span class="sy1">&lt;</span>T<span class="sy1">&gt;</span><span class="br0">(</span>t<span class="br0">)</span><span class="br0">)</span> <span class="br0">}</span> <span class="sy2">-</span><span class="sy1">&gt;</span> ConvertibleTo<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="sy4">;</span>
      <span class="br0">}</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T, <span class="kw1">class</span> U, <span class="kw1">class</span> V<span class="sy1">&gt;</span>
    concept __PairLikeConvertibleFrom <span class="sy1">=</span>                 <span class="co1">// 仅用于阐释</span>
      <span class="sy3">!</span>Range<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> __PairLike<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> Constructible<span class="sy1">&lt;</span>T, U, V<span class="sy1">&gt;</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    concept __IteratorSentinelPair <span class="sy1">=</span>                    <span class="co1">// 仅用于阐释</span>
      <span class="sy3">!</span>Range<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> __PairLike<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
      Sentinel<span class="sy1">&lt;</span>tuple_element_t<span class="sy1">&lt;</span><span class="nu0">1</span>, T<span class="sy1">&gt;</span>, tuple_element_t<span class="sy1">&lt;</span><span class="nu0">0</span>, T<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span>Iterator I, Sentinel<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span> S <span class="sy1">=</span> I, subrange_kind K <span class="sy1">=</span>
      SizedSentinel<span class="sy1">&lt;</span>S, I<span class="sy1">&gt;</span> <span class="sy4">?</span> subrange_kind<span class="sy4">::</span><span class="me2">sized</span> <span class="sy4">:</span> subrange_kind<span class="sy4">::</span><span class="me2">unsized</span><span class="sy1">&gt;</span>
    requires <span class="br0">(</span>K <span class="sy1">==</span> subrange_kind<span class="sy4">::</span><span class="me2">sized</span> <span class="sy3">||</span> <span class="sy3">!</span>SizedSentinel<span class="sy1">&lt;</span>S, I<span class="sy1">&gt;</span><span class="br0">)</span>
  <span class="kw1">class</span> subrange <span class="sy4">:</span> <span class="kw1">public</span> view_interface<span class="sy1">&lt;</span>subrange<span class="sy1">&lt;</span>I, S, K<span class="sy1">&gt;&gt;</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    <span class="kw4">static</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> StoreSize <span class="sy1">=</span>                   <span class="co1">// 仅用于阐释</span>
      K <span class="sy1">==</span> subrange_kind<span class="sy4">::</span><span class="me2">sized</span> <span class="sy3">&amp;&amp;</span> <span class="sy3">!</span>SizedSentinel<span class="sy1">&lt;</span>S, I<span class="sy1">&gt;</span><span class="sy4">;</span>
    I begin_ <span class="sy1">=</span> I<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>                                     <span class="co1">// 仅用于阐释</span>
    S end_ <span class="sy1">=</span> S<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>                                       <span class="co1">// 仅用于阐释</span>
    iter_difference_t<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span> size_ <span class="sy1">=</span> <span class="nu0">0</span><span class="sy4">;</span>                     <span class="co1">// 仅用于阐释；</span>
                                                        <span class="co1">// 仅当 StoreSize 为 true 时才存在</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    subrange<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> subrange<span class="br0">(</span>I i, S s<span class="br0">)</span> requires <span class="br0">(</span><span class="sy3">!</span>StoreSize<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> subrange<span class="br0">(</span>I i, S s, iter_difference_t<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span> n<span class="br0">)</span>
      requires <span class="br0">(</span>K <span class="sy1">==</span> subrange_kind<span class="sy4">::</span><span class="me2">sized</span><span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw1">template</span><span class="sy1">&lt;</span>__NotSameAs<span class="sy1">&lt;</span>subrange<span class="sy1">&gt;</span> R<span class="sy1">&gt;</span>
      requires __ForwardingRange<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
        ConvertibleTo<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>, I<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> ConvertibleTo<span class="sy1">&lt;</span>sentinel_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>, S<span class="sy1">&gt;</span>
    <span class="kw4">constexpr</span> subrange<span class="br0">(</span>R<span class="sy3">&amp;&amp;</span> r<span class="br0">)</span> requires <span class="br0">(</span><span class="sy3">!</span>StoreSize <span class="sy3">||</span> SizedRange<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span><span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw1">template</span><span class="sy1">&lt;</span>__ForwardingRange R<span class="sy1">&gt;</span>
      requires ConvertibleTo<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>, I<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> ConvertibleTo<span class="sy1">&lt;</span>sentinel_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>, S<span class="sy1">&gt;</span>
    <span class="kw4">constexpr</span> subrange<span class="br0">(</span>R<span class="sy3">&amp;&amp;</span> r, iter_difference_t<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span> n<span class="br0">)</span>
      requires <span class="br0">(</span>K <span class="sy1">==</span> subrange_kind<span class="sy4">::</span><span class="me2">sized</span><span class="br0">)</span>
        <span class="sy4">:</span> subrange<span class="br0">{</span>ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>r<span class="br0">)</span>, ranges<span class="sy4">::</span><span class="me2">end</span><span class="br0">(</span>r<span class="br0">)</span>, n<span class="br0">}</span>
    <span class="br0">{</span><span class="br0">}</span>
 
    <span class="kw1">template</span><span class="sy1">&lt;</span>__NotSameAs<span class="sy1">&lt;</span>subrange<span class="sy1">&gt;</span> PairLike<span class="sy1">&gt;</span>
      requires __PairLikeConvertibleTo<span class="sy1">&lt;</span>PairLike, I, S<span class="sy1">&gt;</span>
    <span class="kw4">constexpr</span> subrange<span class="br0">(</span>PairLike<span class="sy3">&amp;&amp;</span> r<span class="br0">)</span> requires <span class="br0">(</span><span class="sy3">!</span>StoreSize<span class="br0">)</span>
      <span class="sy4">:</span> subrange<span class="br0">{</span>std<span class="sy4">::</span><span class="me2">get</span><span class="sy1">&lt;</span><span class="nu0">0</span><span class="sy1">&gt;</span><span class="br0">(</span><a href="../utility/forward.html"><span class="kw1117">std::<span class="me2">forward</span></span></a><span class="sy1">&lt;</span>PairLike<span class="sy1">&gt;</span><span class="br0">(</span>r<span class="br0">)</span><span class="br0">)</span>,
                 std<span class="sy4">::</span><span class="me2">get</span><span class="sy1">&lt;</span><span class="nu0">1</span><span class="sy1">&gt;</span><span class="br0">(</span><a href="../utility/forward.html"><span class="kw1117">std::<span class="me2">forward</span></span></a><span class="sy1">&lt;</span>PairLike<span class="sy1">&gt;</span><span class="br0">(</span>r<span class="br0">)</span><span class="br0">)</span><span class="br0">}</span>
    <span class="br0">{</span><span class="br0">}</span>
 
    <span class="kw1">template</span><span class="sy1">&lt;</span>__PairLikeConvertibleTo<span class="sy1">&lt;</span>I, S<span class="sy1">&gt;</span> PairLike<span class="sy1">&gt;</span>
    <span class="kw4">constexpr</span> subrange<span class="br0">(</span>PairLike<span class="sy3">&amp;&amp;</span> r, iter_difference_t<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span> n<span class="br0">)</span>
      requires <span class="br0">(</span>K <span class="sy1">==</span> subrange_kind<span class="sy4">::</span><span class="me2">sized</span><span class="br0">)</span>
      <span class="sy4">:</span> subrange<span class="br0">{</span>std<span class="sy4">::</span><span class="me2">get</span><span class="sy1">&lt;</span><span class="nu0">0</span><span class="sy1">&gt;</span><span class="br0">(</span><a href="../utility/forward.html"><span class="kw1117">std::<span class="me2">forward</span></span></a><span class="sy1">&lt;</span>PairLike<span class="sy1">&gt;</span><span class="br0">(</span>r<span class="br0">)</span><span class="br0">)</span>,
                 std<span class="sy4">::</span><span class="me2">get</span><span class="sy1">&lt;</span><span class="nu0">1</span><span class="sy1">&gt;</span><span class="br0">(</span><a href="../utility/forward.html"><span class="kw1117">std::<span class="me2">forward</span></span></a><span class="sy1">&lt;</span>PairLike<span class="sy1">&gt;</span><span class="br0">(</span>r<span class="br0">)</span><span class="br0">)</span>, n<span class="br0">}</span>
    <span class="br0">{</span><span class="br0">}</span>
 
    <span class="kw1">template</span><span class="sy1">&lt;</span>__NotSameAs<span class="sy1">&lt;</span>subrange<span class="sy1">&gt;</span> PairLike<span class="sy1">&gt;</span>
      requires __PairLikeConvertibleFrom<span class="sy1">&lt;</span>PairLike, <span class="kw4">const</span> I<span class="sy3">&amp;</span>, <span class="kw4">const</span> S<span class="sy3">&amp;</span><span class="sy1">&gt;</span>
    <span class="kw4">constexpr</span> operator PairLike<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> I begin<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> S end<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">bool</span> empty<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iter_difference_t<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span> size<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span>
      requires <span class="br0">(</span>K <span class="sy1">==</span> subrange_kind<span class="sy4">::</span><span class="me2">sized</span><span class="br0">)</span><span class="sy4">;</span>
 
    <span class="br0">[</span><span class="br0">[</span>nodiscard<span class="br0">]</span><span class="br0">]</span> <span class="kw4">constexpr</span> subrange next<span class="br0">(</span>iter_difference_t<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span> n <span class="sy1">=</span> <span class="nu0">1</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
    <span class="br0">[</span><span class="br0">[</span>nodiscard<span class="br0">]</span><span class="br0">]</span> <span class="kw4">constexpr</span> subrange prev<span class="br0">(</span>iter_difference_t<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span> n <span class="sy1">=</span> <span class="nu0">1</span><span class="br0">)</span> <span class="kw4">const</span>
      requires BidirectionalIterator<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> subrange<span class="sy3">&amp;</span> advance<span class="br0">(</span>iter_difference_t<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span> n<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> I begin<span class="br0">(</span>subrange<span class="sy3">&amp;&amp;</span> r<span class="br0">)</span> <span class="br0">{</span> <span class="kw1">return</span> r.<span class="me1">begin</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span> <span class="br0">}</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> S end<span class="br0">(</span>subrange<span class="sy3">&amp;&amp;</span> r<span class="br0">)</span> <span class="br0">{</span> <span class="kw1">return</span> r.<span class="me1">end</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span> <span class="br0">}</span>
  <span class="br0">}</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span>Iterator I, Sentinel<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span> S<span class="sy1">&gt;</span>
    subrange<span class="br0">(</span>I, S, iter_difference_t<span class="sy1">&lt;</span>I<span class="sy1">&gt;</span><span class="br0">)</span> <span class="sy2">-</span><span class="sy1">&gt;</span> subrange<span class="sy1">&lt;</span>I, S, subrange_kind<span class="sy4">::</span><span class="me2">sized</span><span class="sy1">&gt;</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span>__IteratorSentinelPair P<span class="sy1">&gt;</span>
    subrange<span class="br0">(</span>P<span class="br0">)</span> <span class="sy2">-</span><span class="sy1">&gt;</span> subrange<span class="sy1">&lt;</span>tuple_element_t<span class="sy1">&lt;</span><span class="nu0">0</span>, P<span class="sy1">&gt;</span>, tuple_element_t<span class="sy1">&lt;</span><span class="nu0">1</span>, P<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span>__IteratorSentinelPair P<span class="sy1">&gt;</span>
    subrange<span class="br0">(</span>P, iter_difference_t<span class="sy1">&lt;</span>tuple_element_t<span class="sy1">&lt;</span><span class="nu0">0</span>, P<span class="sy1">&gt;&gt;</span><span class="br0">)</span> <span class="sy2">-</span><span class="sy1">&gt;</span>
      subrange<span class="sy1">&lt;</span>tuple_element_t<span class="sy1">&lt;</span><span class="nu0">0</span>, P<span class="sy1">&gt;</span>, tuple_element_t<span class="sy1">&lt;</span><span class="nu0">1</span>, P<span class="sy1">&gt;</span>, subrange_kind<span class="sy4">::</span><span class="me2">sized</span><span class="sy1">&gt;</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span>__ForwardingRange R<span class="sy1">&gt;</span>
    subrange<span class="br0">(</span>R<span class="sy3">&amp;&amp;</span><span class="br0">)</span> <span class="sy2">-</span><span class="sy1">&gt;</span>
      subrange<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>, sentinel_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>,
               <span class="br0">(</span>SizedRange<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span> <span class="sy3">||</span> SizedSentinel<span class="sy1">&lt;</span>sentinel_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>, iterator_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span><span class="br0">)</span>
                 <span class="sy4">?</span> subrange_kind<span class="sy4">::</span><span class="me2">sized</span> <span class="sy4">:</span> subrange_kind<span class="sy4">::</span><span class="me2">unsized</span><span class="sy1">&gt;</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span>__ForwardingRange R<span class="sy1">&gt;</span>
    subrange<span class="br0">(</span>R<span class="sy3">&amp;&amp;</span>, iter_difference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span><span class="br0">)</span> <span class="sy2">-</span><span class="sy1">&gt;</span>
      subrange<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>, sentinel_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>, subrange_kind<span class="sy4">::</span><span class="me2">sized</span><span class="sy1">&gt;</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span>size_t N, <span class="kw1">class</span> I, <span class="kw1">class</span> S, subrange_kind K<span class="sy1">&gt;</span>
    requires <span class="br0">(</span>N <span class="sy1">&lt;</span> <span class="nu0">2</span><span class="br0">)</span>
  <span class="kw4">constexpr</span> <span class="kw4">auto</span> get<span class="br0">(</span><span class="kw4">const</span> subrange<span class="sy1">&lt;</span>I, S, K<span class="sy1">&gt;</span><span class="sy3">&amp;</span> r<span class="br0">)</span><span class="sy4">;</span>
<span class="br0">}</span>
 
<span class="kw1">namespace</span> std <span class="br0">{</span>
  <span class="kw1">using</span> ranges<span class="sy4">::</span><span class="me2">get</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB_std::ranges::dangling">类 <span class="t-lc">std::ranges::dangling</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">struct</span> dangling <span class="br0">{</span>
    <span class="kw4">constexpr</span> dangling<span class="br0">(</span><span class="br0">)</span> <span class="kw1">noexcept</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
    <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span>... <span class="me1">Args</span><span class="sy1">&gt;</span>
      <span class="kw4">constexpr</span> dangling<span class="br0">(</span>Args<span class="sy3">&amp;&amp;</span>...<span class="br0">)</span> <span class="kw1">noexcept</span> <span class="br0">{</span> <span class="br0">}</span>
  <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB.E6.A8.A1.E6.9D.BF_std::ranges::empty_view">类模板 <span class="t-lc">std::ranges::empty_view</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> T<span class="sy1">&gt;</span>
    requires is_object_v<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span>
  <span class="kw1">class</span> empty_view <span class="sy4">:</span> <span class="kw1">public</span> view_interface<span class="sy1">&lt;</span>empty_view<span class="sy1">&lt;</span>T<span class="sy1">&gt;&gt;</span> <span class="br0">{</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    <span class="kw4">static</span> <span class="kw4">constexpr</span> T<span class="sy2">*</span> begin<span class="br0">(</span><span class="br0">)</span> <span class="kw1">noexcept</span> <span class="br0">{</span> <span class="kw1">return</span> nullptr<span class="sy4">;</span> <span class="br0">}</span>
    <span class="kw4">static</span> <span class="kw4">constexpr</span> T<span class="sy2">*</span> end<span class="br0">(</span><span class="br0">)</span> <span class="kw1">noexcept</span> <span class="br0">{</span> <span class="kw1">return</span> nullptr<span class="sy4">;</span> <span class="br0">}</span>
    <span class="kw4">static</span> <span class="kw4">constexpr</span> T<span class="sy2">*</span> data<span class="br0">(</span><span class="br0">)</span> <span class="kw1">noexcept</span> <span class="br0">{</span> <span class="kw1">return</span> nullptr<span class="sy4">;</span> <span class="br0">}</span>
    <span class="kw4">static</span> <span class="kw4">constexpr</span> ptrdiff_t size<span class="br0">(</span><span class="br0">)</span> <span class="kw1">noexcept</span> <span class="br0">{</span> <span class="kw1">return</span> <span class="nu0">0</span><span class="sy4">;</span> <span class="br0">}</span>
    <span class="kw4">static</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> empty<span class="br0">(</span><span class="br0">)</span> <span class="kw1">noexcept</span> <span class="br0">{</span> <span class="kw1">return</span> <span class="kw2">true</span><span class="sy4">;</span> <span class="br0">}</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> T<span class="sy2">*</span> begin<span class="br0">(</span>empty_view<span class="br0">)</span> <span class="kw1">noexcept</span> <span class="br0">{</span> <span class="kw1">return</span> nullptr<span class="sy4">;</span> <span class="br0">}</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> T<span class="sy2">*</span> end<span class="br0">(</span>empty_view<span class="br0">)</span> <span class="kw1">noexcept</span> <span class="br0">{</span> <span class="kw1">return</span> nullptr<span class="sy4">;</span> <span class="br0">}</span>
  <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB.E6.A8.A1.E6.9D.BF_std::ranges::empty_view_2">类模板 <span class="t-lc">std::ranges::empty_view</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span>CopyConstructible T<span class="sy1">&gt;</span>
    requires is_object_v<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span>
  <span class="kw1">class</span> single_view <span class="sy4">:</span> <span class="kw1">public</span> view_interface<span class="sy1">&lt;</span>single_view<span class="sy1">&lt;</span>T<span class="sy1">&gt;&gt;</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    semiregular_box<span class="sy1">&lt;</span>T<span class="sy1">&gt;</span> value_<span class="sy4">;</span>  <span class="co1">// 仅用于阐释</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    single_view<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> <span class="kw1">explicit</span> single_view<span class="br0">(</span><span class="kw4">const</span> T<span class="sy3">&amp;</span> t<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> <span class="kw1">explicit</span> single_view<span class="br0">(</span>T<span class="sy3">&amp;&amp;</span> t<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span>... <span class="me1">Args</span><span class="sy1">&gt;</span>
      requires Constructible<span class="sy1">&lt;</span>T, Args...<span class="sy1">&gt;</span>
    <span class="kw4">constexpr</span> single_view<span class="br0">(</span>in_place_t, Args<span class="sy3">&amp;&amp;</span>... <span class="me1">args</span><span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> T<span class="sy2">*</span> begin<span class="br0">(</span><span class="br0">)</span> <span class="kw1">noexcept</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> <span class="kw4">const</span> T<span class="sy2">*</span> begin<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> <span class="kw1">noexcept</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> T<span class="sy2">*</span> end<span class="br0">(</span><span class="br0">)</span> <span class="kw1">noexcept</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> <span class="kw4">const</span> T<span class="sy2">*</span> end<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> <span class="kw1">noexcept</span><span class="sy4">;</span>
    <span class="kw4">static</span> <span class="kw4">constexpr</span> ptrdiff_t size<span class="br0">(</span><span class="br0">)</span> <span class="kw1">noexcept</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> T<span class="sy2">*</span> data<span class="br0">(</span><span class="br0">)</span> <span class="kw1">noexcept</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> <span class="kw4">const</span> T<span class="sy2">*</span> data<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> <span class="kw1">noexcept</span><span class="sy4">;</span>
  <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB.E6.A8.A1.E6.9D.BF_std::ranges::iota_view">类模板 <span class="t-lc">std::ranges::iota_view</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> I<span class="sy1">&gt;</span>
    concept _Decrementable <span class="sy1">=</span>    <span class="co1">// 仅用于阐释</span>
      <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> I<span class="sy1">&gt;</span>
    concept _Advanceable <span class="sy1">=</span>      <span class="co1">// 仅用于阐释</span>
      <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span>WeaklyIncrementable W, Semiregular Bound <span class="sy1">=</span> unreachable_sentinel_t<span class="sy1">&gt;</span>
    requires __WeaklyEqualityComparableWith<span class="sy1">&lt;</span>W, Bound<span class="sy1">&gt;</span>
  <span class="kw1">class</span> iota_view <span class="sy4">:</span> <span class="kw1">public</span> view_interface<span class="sy1">&lt;</span>iota_view<span class="sy1">&lt;</span>W, Bound<span class="sy1">&gt;&gt;</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    <span class="co1">// 类 iota_­view​::​iterator</span>
    <span class="kw1">struct</span> iterator<span class="sy4">;</span>            <span class="co1">// 仅用于阐释</span>
    <span class="co1">// 类 iota_­view​::​sentinel</span>
    <span class="kw1">struct</span> sentinel<span class="sy4">;</span>            <span class="co1">// 仅用于阐释</span>
    W value_ <span class="sy1">=</span> W<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>             <span class="co1">// 仅用于阐释</span>
    Bound bound_ <span class="sy1">=</span> Bound<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>     <span class="co1">// 仅用于阐释</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    iota_view<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> <span class="kw1">explicit</span> iota_view<span class="br0">(</span>W value<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iota_view<span class="br0">(</span>type_identity_t<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span> value,
                        type_identity_t<span class="sy1">&lt;</span>Bound<span class="sy1">&gt;</span> bound<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> iterator begin<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> sentinel end<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iterator end<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> requires Same<span class="sy1">&lt;</span>W, Bound<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> size<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span>
      requires <span class="br0">(</span>Same<span class="sy1">&lt;</span>W, Bound<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> _Advanceable<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span><span class="br0">)</span> <span class="sy3">||</span>
               <span class="br0">(</span>Integral<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> Integral<span class="sy1">&lt;</span>Bound<span class="sy1">&gt;</span><span class="br0">)</span> <span class="sy3">||</span>
               SizedSentinel<span class="sy1">&lt;</span>Bound, W<span class="sy1">&gt;</span>
    <span class="br0">{</span> <span class="kw1">return</span> bound_ <span class="sy2">-</span> value_<span class="sy4">;</span> <span class="br0">}</span>
  <span class="br0">}</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> W, <span class="kw1">class</span> Bound<span class="sy1">&gt;</span>
    requires <span class="br0">(</span><span class="sy3">!</span>Integral<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span> <span class="sy3">||</span> <span class="sy3">!</span>Integral<span class="sy1">&lt;</span>Bound<span class="sy1">&gt;</span> <span class="sy3">||</span> is_signed_v<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span> <span class="sy1">==</span> is_signed_v<span class="sy1">&lt;</span>Bound<span class="sy1">&gt;</span><span class="br0">)</span>
  iota_view<span class="br0">(</span>W, Bound<span class="br0">)</span> <span class="sy2">-</span><span class="sy1">&gt;</span> iota_view<span class="sy1">&lt;</span>W, Bound<span class="sy1">&gt;</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB_std::ranges::iota_view::iterator">类 <span class="t-lc">std::ranges::iota_view::iterator</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> W, <span class="kw1">class</span> Bound<span class="sy1">&gt;</span>
  <span class="kw1">struct</span> iota_view<span class="sy1">&lt;</span>W, Bound<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">iterator</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    W value_ <span class="sy1">=</span> W<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>             <span class="co1">// 仅用于阐释</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    <span class="kw1">using</span> iterator_category <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
    <span class="kw1">using</span> value_type <span class="sy1">=</span> W<span class="sy4">;</span>
    <span class="kw1">using</span> difference_type <span class="sy1">=</span> iter_difference_t<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    iterator<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> <span class="kw1">explicit</span> iterator<span class="br0">(</span>W value<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> W operator<span class="sy2">*</span><span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> <span class="kw1">noexcept</span><span class="br0">(</span>is_nothrow_copy_constructible_v<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span><span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> iterator<span class="sy3">&amp;</span> operator<span class="sy2">++</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> <span class="kw4">void</span> operator<span class="sy2">++</span><span class="br0">(</span><span class="kw4">int</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iterator operator<span class="sy2">++</span><span class="br0">(</span><span class="kw4">int</span><span class="br0">)</span> requires Incrementable<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> iterator<span class="sy3">&amp;</span> operator<span class="sy2">--</span><span class="br0">(</span><span class="br0">)</span> requires _Decrementable<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iterator operator<span class="sy2">--</span><span class="br0">(</span><span class="kw4">int</span><span class="br0">)</span> requires _Decrementable<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> iterator<span class="sy3">&amp;</span> operator<span class="sy2">+</span><span class="sy1">=</span><span class="br0">(</span>difference_type n<span class="br0">)</span>
      requires _Advanceable<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iterator<span class="sy3">&amp;</span> operator<span class="sy2">-</span><span class="sy1">=</span><span class="br0">(</span>difference_type n<span class="br0">)</span>
      requires _Advanceable<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> W operator<span class="br0">[</span><span class="br0">]</span><span class="br0">(</span>difference_type n<span class="br0">)</span> <span class="kw4">const</span>
      requires _Advanceable<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires EqualityComparable<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires EqualityComparable<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">&lt;</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires StrictTotallyOrdered<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">&gt;</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires StrictTotallyOrdered<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">&lt;=</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires StrictTotallyOrdered<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">&gt;=</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires StrictTotallyOrdered<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> iterator operator<span class="sy2">+</span><span class="br0">(</span>iterator i, difference_type n<span class="br0">)</span>
      requires _Advanceable<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> iterator operator<span class="sy2">+</span><span class="br0">(</span>difference_type n, iterator i<span class="br0">)</span>
      requires _Advanceable<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> iterator operator<span class="sy2">-</span><span class="br0">(</span>iterator i, difference_type n<span class="br0">)</span>
      requires _Advanceable<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> difference_type operator<span class="sy2">-</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires _Advanceable<span class="sy1">&lt;</span>W<span class="sy1">&gt;</span><span class="sy4">;</span>
  <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB_std::ranges::iota_view::sentinel">类 <span class="t-lc">std::ranges::iota_view::sentinel</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> W, <span class="kw1">class</span> Bound<span class="sy1">&gt;</span>
  <span class="kw1">struct</span> iota_view<span class="sy1">&lt;</span>W, Bound<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">sentinel</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    Bound bound_ <span class="sy1">=</span> Bound<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>     <span class="co1">// 仅用于阐释</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    sentinel<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> <span class="kw1">explicit</span> sentinel<span class="br0">(</span>Bound bound<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> y<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span><span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> y<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span><span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span><span class="sy4">;</span>
  <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB.E6.A8.A1.E6.9D.BF_std::ranges::ref_view">类模板 <span class="t-lc">std::ranges::ref_view</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span>Range R<span class="sy1">&gt;</span>
    requires is_object_v<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>
  <span class="kw1">class</span> ref_view <span class="sy4">:</span> <span class="kw1">public</span> view_interface<span class="sy1">&lt;</span>ref_view<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    R<span class="sy2">*</span> r_ <span class="sy1">=</span> nullptr<span class="sy4">;</span>            <span class="co1">// 仅用于阐释</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    <span class="kw4">constexpr</span> ref_view<span class="br0">(</span><span class="br0">)</span> <span class="kw1">noexcept</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
 
    <span class="kw1">template</span><span class="sy1">&lt;</span>__NotSameAs<span class="sy1">&lt;</span>ref_view<span class="sy1">&gt;</span> T<span class="sy1">&gt;</span>
      requires <span class="coMULTI">/* 见定义 */</span>
    <span class="kw4">constexpr</span> ref_view<span class="br0">(</span>T<span class="sy3">&amp;&amp;</span> t<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> R<span class="sy3">&amp;</span> base<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> <span class="br0">{</span> <span class="kw1">return</span> <span class="sy2">*</span>r_<span class="sy4">;</span> <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> iterator_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span> begin<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> <span class="br0">{</span> <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span><span class="sy2">*</span>r_<span class="br0">)</span><span class="sy4">;</span> <span class="br0">}</span>
    <span class="kw4">constexpr</span> sentinel_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span> end<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> <span class="br0">{</span> <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">end</span><span class="br0">(</span><span class="sy2">*</span>r_<span class="br0">)</span><span class="sy4">;</span> <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">bool</span> empty<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span>
      requires requires <span class="br0">{</span> ranges<span class="sy4">::</span><span class="me2">empty</span><span class="br0">(</span><span class="sy2">*</span>r_<span class="br0">)</span><span class="sy4">;</span> <span class="br0">}</span>
    <span class="br0">{</span> <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">empty</span><span class="br0">(</span><span class="sy2">*</span>r_<span class="br0">)</span><span class="sy4">;</span> <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> size<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> requires SizedRange<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>
    <span class="br0">{</span> <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">size</span><span class="br0">(</span><span class="sy2">*</span>r_<span class="br0">)</span><span class="sy4">;</span> <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> data<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> requires ContiguousRange<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>
    <span class="br0">{</span> <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">data</span><span class="br0">(</span><span class="sy2">*</span>r_<span class="br0">)</span><span class="sy4">;</span> <span class="br0">}</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> iterator_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span> begin<span class="br0">(</span>ref_view r<span class="br0">)</span>
    <span class="br0">{</span> <span class="kw1">return</span> r.<span class="me1">begin</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span> <span class="br0">}</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> sentinel_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span> end<span class="br0">(</span>ref_view r<span class="br0">)</span>
    <span class="br0">{</span> <span class="kw1">return</span> r.<span class="me1">end</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span> <span class="br0">}</span>
  <span class="br0">}</span><span class="sy4">;</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> R<span class="sy1">&gt;</span>
    ref_view<span class="br0">(</span>R<span class="sy3">&amp;</span><span class="br0">)</span> <span class="sy2">-</span><span class="sy1">&gt;</span> ref_view<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB.E6.A8.A1.E6.9D.BF_std::ranges::filter_view">类模板 <span class="t-lc">std::ranges::filter_view</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span>InputRange V, IndirectUnaryPredicate<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span> Pred<span class="sy1">&gt;</span>
    requires View<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> is_object_v<span class="sy1">&lt;</span>Pred<span class="sy1">&gt;</span>
  <span class="kw1">class</span> filter_view <span class="sy4">:</span> <span class="kw1">public</span> view_interface<span class="sy1">&lt;</span>filter_view<span class="sy1">&lt;</span>V, Pred<span class="sy1">&gt;&gt;</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    V base_ <span class="sy1">=</span> V<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>                  <span class="co1">// 仅用于阐释</span>
    semiregular_box<span class="sy1">&lt;</span>Pred<span class="sy1">&gt;</span> pred_<span class="sy4">;</span>    <span class="co1">// 仅用于阐释</span>
 
    <span class="co1">// 类 filter_view​::​iterator</span>
    <span class="kw1">class</span> iterator<span class="sy4">;</span>                 <span class="co1">// 仅用于阐释</span>
    <span class="co1">// 类 filter_view​::​sentinel</span>
    <span class="kw1">class</span> sentinel<span class="sy4">;</span>                 <span class="co1">// 仅用于阐释</span>
 
  <span class="kw1">public</span><span class="sy4">:</span>
    filter_view<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> filter_view<span class="br0">(</span>V base, Pred pred<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">template</span><span class="sy1">&lt;</span>InputRange R<span class="sy1">&gt;</span>
      requires ViewableRange<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> Constructible<span class="sy1">&lt;</span>V, all_view<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span>
    <span class="kw4">constexpr</span> filter_view<span class="br0">(</span>R<span class="sy3">&amp;&amp;</span> r, Pred pred<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> V base<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> iterator begin<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> end<span class="br0">(</span><span class="br0">)</span> <span class="br0">{</span>
      <span class="kw1">if</span> <span class="kw4">constexpr</span> <span class="br0">(</span>CommonRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="br0">)</span>
        <span class="kw1">return</span> iterator<span class="br0">{</span><span class="sy2">*</span>this, ranges<span class="sy4">::</span><span class="me2">end</span><span class="br0">(</span>base_<span class="br0">)</span><span class="br0">}</span><span class="sy4">;</span>
      <span class="kw1">else</span>
        <span class="kw1">return</span> sentinel<span class="br0">{</span><span class="sy2">*</span>this<span class="br0">}</span><span class="sy4">;</span>
    <span class="br0">}</span>
  <span class="br0">}</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> R, <span class="kw1">class</span> Pred<span class="sy1">&gt;</span>
    filter_view<span class="br0">(</span>R<span class="sy3">&amp;&amp;</span>, Pred<span class="br0">)</span> <span class="sy2">-</span><span class="sy1">&gt;</span> filter_view<span class="sy1">&lt;</span>all_view<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>, Pred<span class="sy1">&gt;</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB_std::ranges::filter_view::iterator">类 <span class="t-lc">std::ranges::filter_view::iterator</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> V, <span class="kw1">class</span> Pred<span class="sy1">&gt;</span>
  <span class="kw1">class</span> filter_view<span class="sy1">&lt;</span>V, Pred<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">iterator</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> current_ <span class="sy1">=</span> iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>   <span class="co1">// 仅用于阐释</span>
    filter_view<span class="sy2">*</span> parent_ <span class="sy1">=</span> nullptr<span class="sy4">;</span>             <span class="co1">// 仅用于阐释</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    <span class="kw1">using</span> iterator_concept  <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
    <span class="kw1">using</span> iterator_category <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
    <span class="kw1">using</span> value_type        <span class="sy1">=</span> iter_value_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
    <span class="kw1">using</span> difference_type   <span class="sy1">=</span> iter_difference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
 
    iterator<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iterator<span class="br0">(</span>filter_view<span class="sy3">&amp;</span> parent, iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> current<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> base<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span> operator<span class="sy2">*</span><span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> operator<span class="sy2">-</span><span class="sy1">&gt;</span><span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span>
      requires has<span class="sy2">-</span>arrow<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> iterator<span class="sy3">&amp;</span> operator<span class="sy2">++</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> <span class="kw4">void</span> operator<span class="sy2">++</span><span class="br0">(</span><span class="kw4">int</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iterator operator<span class="sy2">++</span><span class="br0">(</span><span class="kw4">int</span><span class="br0">)</span> requires ForwardRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> iterator<span class="sy3">&amp;</span> operator<span class="sy2">--</span><span class="br0">(</span><span class="br0">)</span> requires BidirectionalRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iterator operator<span class="sy2">--</span><span class="br0">(</span><span class="kw4">int</span><span class="br0">)</span> requires BidirectionalRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires EqualityComparable<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires EqualityComparable<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> iter_rvalue_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span> iter_move<span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> i<span class="br0">)</span>
      <span class="kw1">noexcept</span><span class="br0">(</span><span class="kw1">noexcept</span><span class="br0">(</span>ranges<span class="sy4">::</span><span class="me2">iter_move</span><span class="br0">(</span>i.<span class="me1">current_</span><span class="br0">)</span><span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">void</span> iter_swap<span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      <span class="kw1">noexcept</span><span class="br0">(</span><span class="kw1">noexcept</span><span class="br0">(</span>ranges<span class="sy4">::</span><span class="me2">iter_swap</span><span class="br0">(</span>x.<span class="me1">current_</span>, y.<span class="me1">current_</span><span class="br0">)</span><span class="br0">)</span><span class="br0">)</span>
      requires IndirectlySwappable<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
  <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB_std::ranges::filter_view::sentinel">类 <span class="t-lc">std::ranges::filter_view::sentinel</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> V, <span class="kw1">class</span> Pred<span class="sy1">&gt;</span>
  <span class="kw1">class</span> filter_view<span class="sy1">&lt;</span>V, Pred<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">sentinel</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    sentinel_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> end_ <span class="sy1">=</span> sentinel_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>       <span class="co1">// 仅用于阐释</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    sentinel<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> <span class="kw1">explicit</span> sentinel<span class="br0">(</span>filter_view<span class="sy3">&amp;</span> parent<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> sentinel_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> base<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> y<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span><span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> y<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span><span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span><span class="sy4">;</span>
  <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB.E6.A8.A1.E6.9D.BF_std::ranges::transform_view">类模板 <span class="t-lc">std::ranges::transform_view</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span>InputRange V, CopyConstructible F<span class="sy1">&gt;</span>
    requires View<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> is_object_v<span class="sy1">&lt;</span>F<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
             RegularInvocable<span class="sy1">&lt;</span>F<span class="sy3">&amp;</span>, iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;&gt;</span>
  <span class="kw1">class</span> transform_view <span class="sy4">:</span> <span class="kw1">public</span> view_interface<span class="sy1">&lt;</span>transform_view<span class="sy1">&lt;</span>V, F<span class="sy1">&gt;&gt;</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    <span class="co1">// 类模板 transform_view​::​iterator</span>
    <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw4">bool</span><span class="sy1">&gt;</span> <span class="kw1">struct</span> iterator<span class="sy4">;</span>             <span class="co1">// 仅用于阐释</span>
    <span class="co1">// 类模板 transform_view​::​sentinel</span>
    <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw4">bool</span><span class="sy1">&gt;</span> <span class="kw1">struct</span> sentinel<span class="sy4">;</span>             <span class="co1">// 仅用于阐释</span>
 
    V base_ <span class="sy1">=</span> V<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>                              <span class="co1">// 仅用于阐释</span>
    semiregular_box<span class="sy1">&lt;</span>F<span class="sy1">&gt;</span> fun_<span class="sy4">;</span>                    <span class="co1">// 仅用于阐释</span>
 
  <span class="kw1">public</span><span class="sy4">:</span>
    transform_view<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> transform_view<span class="br0">(</span>V base, F fun<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">template</span><span class="sy1">&lt;</span>InputRange R<span class="sy1">&gt;</span>
      requires ViewableRange<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> Constructible<span class="sy1">&lt;</span>V, all_view<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span>
    <span class="kw4">constexpr</span> transform_view<span class="br0">(</span>R<span class="sy3">&amp;&amp;</span> r, F fun<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> V base<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> iterator<span class="sy1">&lt;</span><span class="kw2">false</span><span class="sy1">&gt;</span> begin<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iterator<span class="sy1">&lt;</span><span class="kw2">true</span><span class="sy1">&gt;</span> begin<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span>
      requires Range<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
               RegularInvocable<span class="sy1">&lt;</span><span class="kw4">const</span> F<span class="sy3">&amp;</span>, iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;&gt;&gt;</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> sentinel<span class="sy1">&lt;</span><span class="kw2">false</span><span class="sy1">&gt;</span> end<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iterator<span class="sy1">&lt;</span><span class="kw2">false</span><span class="sy1">&gt;</span> end<span class="br0">(</span><span class="br0">)</span> requires CommonRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> sentinel<span class="sy1">&lt;</span><span class="kw2">true</span><span class="sy1">&gt;</span> end<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span>
      requires Range<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
               RegularInvocable<span class="sy1">&lt;</span><span class="kw4">const</span> F<span class="sy3">&amp;</span>, iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;&gt;&gt;</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iterator<span class="sy1">&lt;</span><span class="kw2">true</span><span class="sy1">&gt;</span> end<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span>
      requires CommonRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
               RegularInvocable<span class="sy1">&lt;</span><span class="kw4">const</span> F<span class="sy3">&amp;</span>, iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;&gt;&gt;</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> size<span class="br0">(</span><span class="br0">)</span> requires SizedRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="br0">{</span> <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">size</span><span class="br0">(</span>base_<span class="br0">)</span><span class="sy4">;</span> <span class="br0">}</span>
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> size<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> requires SizedRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span>
    <span class="br0">{</span> <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">size</span><span class="br0">(</span>base_<span class="br0">)</span><span class="sy4">;</span> <span class="br0">}</span>
  <span class="br0">}</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> R, <span class="kw1">class</span> F<span class="sy1">&gt;</span>
    transform_view<span class="br0">(</span>R<span class="sy3">&amp;&amp;</span>, F<span class="br0">)</span> <span class="sy2">-</span><span class="sy1">&gt;</span> transform_view<span class="sy1">&lt;</span>all_view<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>, F<span class="sy1">&gt;</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB.E6.A8.A1.E6.9D.BF_std::ranges::transform_view::iterator">类模板 <span class="t-lc">std::ranges::transform_view::iterator</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> V, <span class="kw1">class</span> F<span class="sy1">&gt;</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw4">bool</span> Const<span class="sy1">&gt;</span>
  <span class="kw1">class</span> transform_view<span class="sy1">&lt;</span>V, F<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">iterator</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    <span class="kw1">using</span> Parent <span class="sy1">=</span>                              <span class="co1">// 仅用于阐释</span>
      conditional_t<span class="sy1">&lt;</span>Const, <span class="kw4">const</span> transform_view, transform_view<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw1">using</span> Base   <span class="sy1">=</span>                              <span class="co1">// 仅用于阐释</span>
      conditional_t<span class="sy1">&lt;</span>Const, <span class="kw4">const</span> V, V<span class="sy1">&gt;</span><span class="sy4">;</span>
    iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span> current_ <span class="sy1">=</span>                 <span class="co1">// 仅用于阐释</span>
      iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>
    Parent<span class="sy2">*</span> parent_ <span class="sy1">=</span> nullptr<span class="sy4">;</span>                  <span class="co1">// 仅用于阐释</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    <span class="kw1">using</span> iterator_concept  <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
    <span class="kw1">using</span> iterator_category <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
    <span class="kw1">using</span> value_type        <span class="sy1">=</span>
      remove_cvref_t<span class="sy1">&lt;</span>invoke_result_t<span class="sy1">&lt;</span>F<span class="sy3">&amp;</span>, iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;&gt;&gt;</span><span class="sy4">;</span>
    <span class="kw1">using</span> difference_type   <span class="sy1">=</span> iter_difference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
 
    iterator<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iterator<span class="br0">(</span>Parent<span class="sy3">&amp;</span> parent, iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span> current<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iterator<span class="br0">(</span>iterator<span class="sy1">&lt;</span><span class="sy3">!</span>Const<span class="sy1">&gt;</span> i<span class="br0">)</span>
      requires Const <span class="sy3">&amp;&amp;</span> ConvertibleTo<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span>, iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span> base<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> decltype<span class="br0">(</span><span class="kw4">auto</span><span class="br0">)</span> operator<span class="sy2">*</span><span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span>
    <span class="br0">{</span> <span class="kw1">return</span> invoke<span class="br0">(</span><span class="sy2">*</span>parent_<span class="sy2">-</span><span class="sy1">&gt;</span>fun_, <span class="sy2">*</span>current_<span class="br0">)</span><span class="sy4">;</span> <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> iterator<span class="sy3">&amp;</span> operator<span class="sy2">++</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> <span class="kw4">void</span> operator<span class="sy2">++</span><span class="br0">(</span><span class="kw4">int</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iterator operator<span class="sy2">++</span><span class="br0">(</span><span class="kw4">int</span><span class="br0">)</span> requires ForwardRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> iterator<span class="sy3">&amp;</span> operator<span class="sy2">--</span><span class="br0">(</span><span class="br0">)</span> requires BidirectionalRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iterator operator<span class="sy2">--</span><span class="br0">(</span><span class="kw4">int</span><span class="br0">)</span> requires BidirectionalRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> iterator<span class="sy3">&amp;</span> operator<span class="sy2">+</span><span class="sy1">=</span><span class="br0">(</span>difference_type n<span class="br0">)</span>
      requires RandomAccessRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iterator<span class="sy3">&amp;</span> operator<span class="sy2">-</span><span class="sy1">=</span><span class="br0">(</span>difference_type n<span class="br0">)</span>
      requires RandomAccessRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> decltype<span class="br0">(</span><span class="kw4">auto</span><span class="br0">)</span> operator<span class="br0">[</span><span class="br0">]</span><span class="br0">(</span>difference_type n<span class="br0">)</span> <span class="kw4">const</span>
      requires RandomAccessRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span>
    <span class="br0">{</span> <span class="kw1">return</span> invoke<span class="br0">(</span><span class="sy2">*</span>parent_<span class="sy2">-</span><span class="sy1">&gt;</span>fun_, current_<span class="br0">[</span>n<span class="br0">]</span><span class="br0">)</span><span class="sy4">;</span> <span class="br0">}</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires EqualityComparable<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires EqualityComparable<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">&lt;</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires RandomAccessRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">&gt;</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires RandomAccessRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">&lt;=</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires RandomAccessRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">&gt;=</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires RandomAccessRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> iterator operator<span class="sy2">+</span><span class="br0">(</span>iterator i, difference_type n<span class="br0">)</span>
      requires RandomAccessRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> iterator operator<span class="sy2">+</span><span class="br0">(</span>difference_type n, iterator i<span class="br0">)</span>
      requires RandomAccessRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> iterator operator<span class="sy2">-</span><span class="br0">(</span>iterator i, difference_type n<span class="br0">)</span>
      requires RandomAccessRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> difference_type operator<span class="sy2">-</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires RandomAccessRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> decltype<span class="br0">(</span><span class="kw4">auto</span><span class="br0">)</span> iter_move<span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> i<span class="br0">)</span>
      <span class="kw1">noexcept</span><span class="br0">(</span><span class="kw1">noexcept</span><span class="br0">(</span>invoke<span class="br0">(</span><span class="sy2">*</span>i.<span class="me1">parent_</span><span class="sy2">-</span><span class="sy1">&gt;</span>fun_, <span class="sy2">*</span>i.<span class="me1">current_</span><span class="br0">)</span><span class="br0">)</span><span class="br0">)</span>
    <span class="br0">{</span>
      <span class="kw1">if</span> <span class="kw4">constexpr</span> <span class="br0">(</span>is_lvalue_reference_v<span class="sy1">&lt;</span>decltype<span class="br0">(</span><span class="sy2">*</span>i<span class="br0">)</span><span class="sy1">&gt;</span><span class="br0">)</span>
        <span class="kw1">return</span> std<span class="sy4">::</span><span class="me2">move</span><span class="br0">(</span><span class="sy2">*</span>i<span class="br0">)</span><span class="sy4">;</span>
      <span class="kw1">else</span>
        <span class="kw1">return</span> <span class="sy2">*</span>i<span class="sy4">;</span>
    <span class="br0">}</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">void</span> iter_swap<span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      <span class="kw1">noexcept</span><span class="br0">(</span><span class="kw1">noexcept</span><span class="br0">(</span>ranges<span class="sy4">::</span><span class="me2">iter_swap</span><span class="br0">(</span>x.<span class="me1">current_</span>, y.<span class="me1">current_</span><span class="br0">)</span><span class="br0">)</span><span class="br0">)</span>
      requires IndirectlySwappable<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
  <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB.E6.A8.A1.E6.9D.BF_std::ranges::transform_view::sentinel">类模板 <span class="t-lc">std::ranges::transform_view::sentinel</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> V, <span class="kw1">class</span> F<span class="sy1">&gt;</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw4">bool</span> Const<span class="sy1">&gt;</span>
  <span class="kw1">class</span> transform_view<span class="sy1">&lt;</span>V, F<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">sentinel</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    <span class="kw1">using</span> Parent <span class="sy1">=</span>                                      <span class="co1">// 仅用于阐释</span>
      conditional_t<span class="sy1">&lt;</span>Const, <span class="kw4">const</span> transform_view, transform_view<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw1">using</span> Base <span class="sy1">=</span> conditional_t<span class="sy1">&lt;</span>Const, <span class="kw4">const</span> V, V<span class="sy1">&gt;</span><span class="sy4">;</span>      <span class="co1">// 仅用于阐释</span>
    sentinel_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span> end_ <span class="sy1">=</span> sentinel_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>         <span class="co1">// 仅用于阐释</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    sentinel<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> <span class="kw1">explicit</span> sentinel<span class="br0">(</span>sentinel_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span> end<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> sentinel<span class="br0">(</span>sentinel<span class="sy1">&lt;</span><span class="sy3">!</span>Const<span class="sy1">&gt;</span> i<span class="br0">)</span>
      requires Const <span class="sy3">&amp;&amp;</span> ConvertibleTo<span class="sy1">&lt;</span>sentinel_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span>, sentinel_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> sentinel_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span> base<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy1">&lt;</span>Const<span class="sy1">&gt;</span><span class="sy3">&amp;</span> x, <span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> y<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span><span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy1">&lt;</span>Const<span class="sy1">&gt;</span><span class="sy3">&amp;</span> y<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy1">&lt;</span>Const<span class="sy1">&gt;</span><span class="sy3">&amp;</span> x, <span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> y<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span><span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy1">&lt;</span>Const<span class="sy1">&gt;</span><span class="sy3">&amp;</span> y<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> iter_difference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span>
      operator<span class="sy2">-</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy1">&lt;</span>Const<span class="sy1">&gt;</span><span class="sy3">&amp;</span> x, <span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> y<span class="br0">)</span>
        requires SizedSentinel<span class="sy1">&lt;</span>sentinel_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span>, iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> iter_difference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span>
      operator<span class="sy2">-</span><span class="br0">(</span><span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> y, <span class="kw4">const</span> iterator<span class="sy1">&lt;</span>Const<span class="sy1">&gt;</span><span class="sy3">&amp;</span> x<span class="br0">)</span>
        requires SizedSentinel<span class="sy1">&lt;</span>sentinel_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span>, iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
  <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB.E6.A8.A1.E6.9D.BF_std::ranges::take_view">类模板 <span class="t-lc">std::ranges::take_view</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span>View V<span class="sy1">&gt;</span>
  <span class="kw1">class</span> take_view <span class="sy4">:</span> <span class="kw1">public</span> view_interface<span class="sy1">&lt;</span>take_view<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    V base_ <span class="sy1">=</span> V<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>                                      <span class="co1">// 仅用于阐释</span>
    iter_difference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span> count_ <span class="sy1">=</span> <span class="nu0">0</span><span class="sy4">;</span>        <span class="co1">// 仅用于阐释</span>
    <span class="co1">// 类模板 take_­view​::​sentinel</span>
    <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw4">bool</span><span class="sy1">&gt;</span> <span class="kw1">struct</span> sentinel<span class="sy4">;</span>                     <span class="co1">// 仅用于阐释</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    take_view<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> take_view<span class="br0">(</span>V base, iter_difference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span> count<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">template</span><span class="sy1">&lt;</span>ViewableRange R<span class="sy1">&gt;</span>
      requires Constructible<span class="sy1">&lt;</span>V, all_view<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span>
    <span class="kw4">constexpr</span> take_view<span class="br0">(</span>R<span class="sy3">&amp;&amp;</span> r, iter_difference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span> count<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> V base<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> begin<span class="br0">(</span><span class="br0">)</span> requires <span class="br0">(</span><span class="sy3">!</span>__SimpleView<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="br0">)</span> <span class="br0">{</span>
      <span class="kw1">if</span> <span class="kw4">constexpr</span> <span class="br0">(</span>SizedRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="br0">)</span> <span class="br0">{</span>
        <span class="kw1">if</span> <span class="kw4">constexpr</span> <span class="br0">(</span>RandomAccessRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="br0">)</span>
          <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>base_<span class="br0">)</span><span class="sy4">;</span>
        <span class="kw1">else</span>
          <span class="kw1">return</span> counted_iterator<span class="br0">{</span>ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>base_<span class="br0">)</span>, size<span class="br0">(</span><span class="br0">)</span><span class="br0">}</span><span class="sy4">;</span>
      <span class="br0">}</span> <span class="kw1">else</span>
        <span class="kw1">return</span> counted_iterator<span class="br0">{</span>ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>base_<span class="br0">)</span>, count_<span class="br0">}</span><span class="sy4">;</span>
    <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> begin<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> requires Range<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span> <span class="br0">{</span>
      <span class="kw1">if</span> <span class="kw4">constexpr</span> <span class="br0">(</span>SizedRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span><span class="br0">)</span> <span class="br0">{</span>
        <span class="kw1">if</span> <span class="kw4">constexpr</span> <span class="br0">(</span>RandomAccessRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span><span class="br0">)</span>
          <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>base_<span class="br0">)</span><span class="sy4">;</span>
        <span class="kw1">else</span>
          <span class="kw1">return</span> counted_iterator<span class="br0">{</span>ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>base_<span class="br0">)</span>, size<span class="br0">(</span><span class="br0">)</span><span class="br0">}</span><span class="sy4">;</span>
      <span class="br0">}</span> <span class="kw1">else</span>
        <span class="kw1">return</span> counted_iterator<span class="br0">{</span>ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>base_<span class="br0">)</span>, count_<span class="br0">}</span><span class="sy4">;</span>
    <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> end<span class="br0">(</span><span class="br0">)</span> requires <span class="br0">(</span><span class="sy3">!</span>__SimpleView<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="br0">)</span> <span class="br0">{</span>
      <span class="kw1">if</span> <span class="kw4">constexpr</span> <span class="br0">(</span>SizedRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="br0">)</span> <span class="br0">{</span>
        <span class="kw1">if</span> <span class="kw4">constexpr</span> <span class="br0">(</span>RandomAccessRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="br0">)</span>
          <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>base_<span class="br0">)</span> <span class="sy2">+</span> size<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>
        <span class="kw1">else</span>
          <span class="kw1">return</span> default_sentinel<span class="sy4">;</span>
      <span class="br0">}</span> <span class="kw1">else</span>
        <span class="kw1">return</span> sentinel<span class="sy1">&lt;</span><span class="kw2">false</span><span class="sy1">&gt;</span><span class="br0">{</span>ranges<span class="sy4">::</span><span class="me2">end</span><span class="br0">(</span>base_<span class="br0">)</span><span class="br0">}</span><span class="sy4">;</span>
    <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> end<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> requires Range<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span> <span class="br0">{</span>
      <span class="kw1">if</span> <span class="kw4">constexpr</span> <span class="br0">(</span>SizedRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span><span class="br0">)</span> <span class="br0">{</span>
        <span class="kw1">if</span> <span class="kw4">constexpr</span> <span class="br0">(</span>RandomAccessRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span><span class="br0">)</span>
          <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>base_<span class="br0">)</span> <span class="sy2">+</span> size<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>
        <span class="kw1">else</span>
          <span class="kw1">return</span> default_sentinel<span class="sy4">;</span>
      <span class="br0">}</span> <span class="kw1">else</span>
        <span class="kw1">return</span> sentinel<span class="sy1">&lt;</span><span class="kw2">true</span><span class="sy1">&gt;</span><span class="br0">{</span>ranges<span class="sy4">::</span><span class="me2">end</span><span class="br0">(</span>base_<span class="br0">)</span><span class="br0">}</span><span class="sy4">;</span>
    <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> size<span class="br0">(</span><span class="br0">)</span> requires SizedRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="br0">{</span>
      <span class="kw4">auto</span> n <span class="sy1">=</span> ranges<span class="sy4">::</span><span class="me2">size</span><span class="br0">(</span>base_<span class="br0">)</span><span class="sy4">;</span>
      <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">min</span><span class="br0">(</span>n, <span class="kw1">static_cast</span><span class="sy1">&lt;</span>decltype<span class="br0">(</span>n<span class="br0">)</span><span class="sy1">&gt;</span><span class="br0">(</span>count_<span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> size<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> requires SizedRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span> <span class="br0">{</span>
      <span class="kw4">auto</span> n <span class="sy1">=</span> ranges<span class="sy4">::</span><span class="me2">size</span><span class="br0">(</span>base_<span class="br0">)</span><span class="sy4">;</span>
      <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">min</span><span class="br0">(</span>n, <span class="kw1">static_cast</span><span class="sy1">&lt;</span>decltype<span class="br0">(</span>n<span class="br0">)</span><span class="sy1">&gt;</span><span class="br0">(</span>count_<span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="br0">}</span>
  <span class="br0">}</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span>Range R<span class="sy1">&gt;</span>
    take_view<span class="br0">(</span>R<span class="sy3">&amp;&amp;</span>, iter_difference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span><span class="br0">)</span>
      <span class="sy2">-</span><span class="sy1">&gt;</span> take_view<span class="sy1">&lt;</span>all_view<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB.E6.A8.A1.E6.9D.BF_std::ranges::take_view::sentinel">类模板 <span class="t-lc">std::ranges::take_view::sentinel</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> V<span class="sy1">&gt;</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw4">bool</span> Const<span class="sy1">&gt;</span>
  <span class="kw1">class</span> take_view<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">sentinel</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    <span class="kw1">using</span> Base <span class="sy1">=</span> conditional_t<span class="sy1">&lt;</span>Const, <span class="kw4">const</span> V, V<span class="sy1">&gt;</span><span class="sy4">;</span>      <span class="co1">// 仅用于阐释</span>
    <span class="kw1">using</span> CI <span class="sy1">=</span> counted_iterator<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>      <span class="co1">// 仅用于阐释</span>
    sentinel_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span> end_ <span class="sy1">=</span> sentinel_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>         <span class="co1">// 仅用于阐释</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    sentinel<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> <span class="kw1">explicit</span> sentinel<span class="br0">(</span>sentinel_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span> end<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> sentinel<span class="br0">(</span>sentinel<span class="sy1">&lt;</span><span class="sy3">!</span>Const<span class="sy1">&gt;</span> s<span class="br0">)</span>
      requires Const <span class="sy3">&amp;&amp;</span> ConvertibleTo<span class="sy1">&lt;</span>sentinel_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span>, sentinel_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> sentinel_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span> base<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span><span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> x, <span class="kw4">const</span> CI<span class="sy3">&amp;</span> y<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span><span class="kw4">const</span> CI<span class="sy3">&amp;</span> y, <span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> x<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span><span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> x, <span class="kw4">const</span> CI<span class="sy3">&amp;</span> y<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span><span class="kw4">const</span> CI<span class="sy3">&amp;</span> y, <span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> x<span class="br0">)</span><span class="sy4">;</span>
  <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB.E6.A8.A1.E6.9D.BF_std::ranges::join_view">类模板 <span class="t-lc">std::ranges::join_view</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span>InputRange V<span class="sy1">&gt;</span>
    requires View<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> InputRange<span class="sy1">&lt;</span>iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;&gt;</span> <span class="sy3">&amp;&amp;</span>
             <span class="br0">(</span>is_reference_v<span class="sy1">&lt;</span>iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;&gt;</span> <span class="sy3">||</span>
              View<span class="sy1">&lt;</span>iter_value_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;&gt;</span><span class="br0">)</span>
  <span class="kw1">class</span> join_view <span class="sy4">:</span> <span class="kw1">public</span> view_interface<span class="sy1">&lt;</span>join_view<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    <span class="kw1">using</span> InnerRng <span class="sy1">=</span>                    <span class="co1">// 仅用于阐释</span>
      iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
    <span class="co1">// 类模板 join_­view​::​iterator</span>
    <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw4">bool</span> Const<span class="sy1">&gt;</span>
      <span class="kw1">struct</span> iterator<span class="sy4">;</span>                  <span class="co1">// 仅用于阐释</span>
    <span class="co1">// 类模板 join_­view​::​sentinel</span>
    <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw4">bool</span> Const<span class="sy1">&gt;</span>
      <span class="kw1">struct</span> sentinel<span class="sy4">;</span>                  <span class="co1">// 仅用于阐释</span>
 
    V base_ <span class="sy1">=</span> V<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>                      <span class="co1">// 仅用于阐释</span>
    all_view<span class="sy1">&lt;</span>InnerRng<span class="sy1">&gt;</span> inner_ <span class="sy1">=</span>         <span class="co1">// 仅用于阐释，</span>
      all_view<span class="sy1">&lt;</span>InnerRng<span class="sy1">&gt;</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>             <span class="co1">// 仅当 !is_reference_v&lt;InnerRng&gt; 时才存在</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    join_view<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> <span class="kw1">explicit</span> join_view<span class="br0">(</span>V base<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw1">template</span><span class="sy1">&lt;</span>InputRange R<span class="sy1">&gt;</span>
      requires ViewableRange<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> Constructible<span class="sy1">&lt;</span>V, all_view<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span>
    <span class="kw4">constexpr</span> <span class="kw1">explicit</span> join_view<span class="br0">(</span>R<span class="sy3">&amp;&amp;</span> r<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> begin<span class="br0">(</span><span class="br0">)</span> <span class="br0">{</span>
      <span class="kw1">return</span> iterator<span class="sy1">&lt;</span>__SimpleView<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span><span class="br0">{</span><span class="sy2">*</span>this, ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>base_<span class="br0">)</span><span class="br0">}</span><span class="sy4">;</span>
    <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> begin<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span>
    requires InputRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
             is_reference_v<span class="sy1">&lt;</span>iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;&gt;&gt;</span> <span class="br0">{</span>
      <span class="kw1">return</span> iterator<span class="sy1">&lt;</span><span class="kw2">true</span><span class="sy1">&gt;</span><span class="br0">{</span><span class="sy2">*</span>this, ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>base_<span class="br0">)</span><span class="br0">}</span><span class="sy4">;</span>
    <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> end<span class="br0">(</span><span class="br0">)</span> <span class="br0">{</span>
      <span class="kw1">if</span> <span class="kw4">constexpr</span> <span class="br0">(</span>ForwardRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
                    is_reference_v<span class="sy1">&lt;</span>InnerRng<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> ForwardRange<span class="sy1">&lt;</span>InnerRng<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
                    CommonRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> CommonRange<span class="sy1">&lt;</span>InnerRng<span class="sy1">&gt;</span><span class="br0">)</span>
        <span class="kw1">return</span> iterator<span class="sy1">&lt;</span>__SimpleView<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span><span class="br0">{</span><span class="sy2">*</span>this, ranges<span class="sy4">::</span><span class="me2">end</span><span class="br0">(</span>base_<span class="br0">)</span><span class="br0">}</span><span class="sy4">;</span>
      <span class="kw1">else</span>
        <span class="kw1">return</span> sentinel<span class="sy1">&lt;</span>__SimpleView<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span><span class="br0">{</span><span class="sy2">*</span>this<span class="br0">}</span><span class="sy4">;</span>
    <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> end<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span>
    requires InputRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
             is_reference_v<span class="sy1">&lt;</span>iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;&gt;&gt;</span> <span class="br0">{</span>
      <span class="kw1">if</span> <span class="kw4">constexpr</span> <span class="br0">(</span>ForwardRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
                    is_reference_v<span class="sy1">&lt;</span>iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;&gt;&gt;</span> <span class="sy3">&amp;&amp;</span>
                    ForwardRange<span class="sy1">&lt;</span>iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;&gt;&gt;</span> <span class="sy3">&amp;&amp;</span>
                    CommonRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
                    CommonRange<span class="sy1">&lt;</span>iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;&gt;&gt;</span><span class="br0">)</span>
        <span class="kw1">return</span> iterator<span class="sy1">&lt;</span><span class="kw2">true</span><span class="sy1">&gt;</span><span class="br0">{</span><span class="sy2">*</span>this, ranges<span class="sy4">::</span><span class="me2">end</span><span class="br0">(</span>base_<span class="br0">)</span><span class="br0">}</span><span class="sy4">;</span>
      <span class="kw1">else</span>
        <span class="kw1">return</span> sentinel<span class="sy1">&lt;</span><span class="kw2">true</span><span class="sy1">&gt;</span><span class="br0">{</span><span class="sy2">*</span>this<span class="br0">}</span><span class="sy4">;</span>
    <span class="br0">}</span>
  <span class="br0">}</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> R<span class="sy1">&gt;</span>
    <span class="kw1">explicit</span> join_view<span class="br0">(</span>R<span class="sy3">&amp;&amp;</span><span class="br0">)</span> <span class="sy2">-</span><span class="sy1">&gt;</span> join_view<span class="sy1">&lt;</span>all_view<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB.E6.A8.A1.E6.9D.BF_std::ranges::join_view::iterator">类模板 <span class="t-lc">std::ranges::join_view::iterator</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
<span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> V<span class="sy1">&gt;</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw4">bool</span> Const<span class="sy1">&gt;</span>
  <span class="kw1">struct</span> join_view<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">iterator</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    <span class="kw1">using</span> Parent <span class="sy1">=</span>                                              <span class="co1">// 仅用于阐释</span>
      conditional_t<span class="sy1">&lt;</span>Const, <span class="kw4">const</span> join_view, join_view<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw1">using</span> Base   <span class="sy1">=</span> conditional_t<span class="sy1">&lt;</span>Const, <span class="kw4">const</span> V, V<span class="sy1">&gt;</span><span class="sy4">;</span>            <span class="co1">// 仅用于阐释</span>
 
    <span class="kw4">static</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> ref_is_glvalue <span class="sy1">=</span>                      <span class="co1">// 仅用于阐释</span>
      is_reference_v<span class="sy1">&lt;</span>iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;&gt;</span><span class="sy4">;</span>
 
    iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span> outer_ <span class="sy1">=</span> iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>               <span class="co1">// 仅用于阐释</span>
    iterator_t<span class="sy1">&lt;</span>iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;&gt;</span> inner_ <span class="sy1">=</span>     <span class="co1">// 仅用于阐释</span>
      iterator_t<span class="sy1">&lt;</span>iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;&gt;</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>
    Parent<span class="sy2">*</span> parent_ <span class="sy1">=</span> nullptr<span class="sy4">;</span>                                  <span class="co1">// 仅用于阐释</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">void</span> satisfy<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>                                   <span class="co1">// 仅用于阐释</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    <span class="kw1">using</span> iterator_concept  <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
    <span class="kw1">using</span> iterator_category <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
    <span class="kw1">using</span> value_type        <span class="sy1">=</span>
      iter_value_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;&gt;&gt;</span><span class="sy4">;</span>
    <span class="kw1">using</span> difference_type   <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
 
    iterator<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iterator<span class="br0">(</span>Parent<span class="sy3">&amp;</span> parent, iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> outer<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iterator<span class="br0">(</span>iterator<span class="sy1">&lt;</span><span class="sy3">!</span>Const<span class="sy1">&gt;</span> i<span class="br0">)</span>
      requires Const <span class="sy3">&amp;&amp;</span>
               ConvertibleTo<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span>, iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span> <span class="sy3">&amp;&amp;</span>
               ConvertibleTo<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>InnerRng<span class="sy1">&gt;</span>,
                             iterator_t<span class="sy1">&lt;</span>iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;&gt;&gt;</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> decltype<span class="br0">(</span><span class="kw4">auto</span><span class="br0">)</span> operator<span class="sy2">*</span><span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> <span class="br0">{</span> <span class="kw1">return</span> <span class="sy2">*</span>inner_<span class="sy4">;</span> <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span> operator<span class="sy2">-</span><span class="sy1">&gt;</span><span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span>
      requires __HasArrow<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> iterator<span class="sy3">&amp;</span> operator<span class="sy2">++</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> <span class="kw4">void</span> operator<span class="sy2">++</span><span class="br0">(</span><span class="kw4">int</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> iterator operator<span class="sy2">++</span><span class="br0">(</span><span class="kw4">int</span><span class="br0">)</span>
      requires ref_is_glvalue <span class="sy3">&amp;&amp;</span> ForwardRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
               ForwardRange<span class="sy1">&lt;</span>iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;&gt;</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> iterator<span class="sy3">&amp;</span> operator<span class="sy2">--</span><span class="br0">(</span><span class="br0">)</span>
      requires ref_is_glvalue <span class="sy3">&amp;&amp;</span> BidirectionalRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
               BidirectionalRange<span class="sy1">&lt;</span>iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;&gt;</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> iterator operator<span class="sy2">--</span><span class="br0">(</span><span class="kw4">int</span><span class="br0">)</span>
      requires ref_is_glvalue <span class="sy3">&amp;&amp;</span> BidirectionalRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
               BidirectionalRange<span class="sy1">&lt;</span>iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;&gt;</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires ref_is_glvalue <span class="sy3">&amp;&amp;</span> EqualityComparable<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span> <span class="sy3">&amp;&amp;</span>
               EqualityComparable<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;&gt;&gt;</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires ref_is_glvalue <span class="sy3">&amp;&amp;</span> EqualityComparable<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span> <span class="sy3">&amp;&amp;</span>
               EqualityComparable<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>iter_reference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;&gt;&gt;</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> decltype<span class="br0">(</span><span class="kw4">auto</span><span class="br0">)</span> iter_move<span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> i<span class="br0">)</span>
    <span class="kw1">noexcept</span><span class="br0">(</span><span class="kw1">noexcept</span><span class="br0">(</span>ranges<span class="sy4">::</span><span class="me2">iter_move</span><span class="br0">(</span>i.<span class="me1">inner_</span><span class="br0">)</span><span class="br0">)</span><span class="br0">)</span> <span class="br0">{</span>
      <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">iter_move</span><span class="br0">(</span>i.<span class="me1">inner_</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="br0">}</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">void</span> iter_swap<span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      <span class="kw1">noexcept</span><span class="br0">(</span><span class="kw1">noexcept</span><span class="br0">(</span>ranges<span class="sy4">::</span><span class="me2">iter_swap</span><span class="br0">(</span>x.<span class="me1">inner_</span>, y.<span class="me1">inner_</span><span class="br0">)</span><span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span>
  <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB.E6.A8.A1.E6.9D.BF_std::ranges::join_view::sentinel">类模板 <span class="t-lc">std::ranges::join_view::sentinel</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> V<span class="sy1">&gt;</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw4">bool</span> Const<span class="sy1">&gt;</span>
  <span class="kw1">struct</span> join_view<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">sentinel</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    <span class="kw1">using</span> Parent <span class="sy1">=</span>                                      <span class="co1">// 仅用于阐释</span>
      conditional_t<span class="sy1">&lt;</span>Const, <span class="kw4">const</span> join_view, join_view<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw1">using</span> Base   <span class="sy1">=</span> conditional_t<span class="sy1">&lt;</span>Const, <span class="kw4">const</span> V, V<span class="sy1">&gt;</span><span class="sy4">;</span>    <span class="co1">// 仅用于阐释</span>
    sentinel_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span> end_ <span class="sy1">=</span> sentinel_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>         <span class="co1">// 仅用于阐释</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    sentinel<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> <span class="kw1">explicit</span> sentinel<span class="br0">(</span>Parent<span class="sy3">&amp;</span> parent<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> sentinel<span class="br0">(</span>sentinel<span class="sy1">&lt;</span><span class="sy3">!</span>Const<span class="sy1">&gt;</span> s<span class="br0">)</span>
      requires Const <span class="sy3">&amp;&amp;</span> ConvertibleTo<span class="sy1">&lt;</span>sentinel_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span>, sentinel_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy1">&lt;</span>Const<span class="sy1">&gt;</span><span class="sy3">&amp;</span> x, <span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> y<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span><span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy1">&lt;</span>Const<span class="sy1">&gt;</span><span class="sy3">&amp;</span> y<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span><span class="kw4">const</span> iterator<span class="sy1">&lt;</span>Const<span class="sy1">&gt;</span><span class="sy3">&amp;</span> x, <span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> y<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span><span class="kw4">const</span> sentinel<span class="sy3">&amp;</span> x, <span class="kw4">const</span> iterator<span class="sy1">&lt;</span>Const<span class="sy1">&gt;</span><span class="sy3">&amp;</span> y<span class="br0">)</span><span class="sy4">;</span>
  <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB.E6.A8.A1.E6.9D.BF_std::ranges::split_.C2.ADview">类模板 <span class="t-lc">std::ranges::split_­view</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw4">auto</span><span class="sy1">&gt;</span> <span class="kw1">struct</span> __require_constant<span class="sy4">;</span>     <span class="co1">// 仅用于阐释</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> R<span class="sy1">&gt;</span>
  concept __TinyRange <span class="sy1">=</span>                         <span class="co1">// 仅用于阐释</span>
    SizedRange<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
    requires <span class="br0">{</span> <span class="kw1">typename</span> __require_constant<span class="sy1">&lt;</span>remove_reference_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">size</span><span class="br0">(</span><span class="br0">)</span><span class="sy1">&gt;</span><span class="sy4">;</span> <span class="br0">}</span> <span class="sy3">&amp;&amp;</span>
    <span class="br0">(</span>remove_reference_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">size</span><span class="br0">(</span><span class="br0">)</span> <span class="sy1">&lt;=</span> <span class="nu0">1</span><span class="br0">)</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span>InputRange V, ForwardRange Pattern<span class="sy1">&gt;</span>
    requires View<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> View<span class="sy1">&lt;</span>Pattern<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
             IndirectlyComparable<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span>, iterator_t<span class="sy1">&lt;</span>Pattern<span class="sy1">&gt;</span>, ranges<span class="sy4">::</span><span class="me2">equal_to</span><span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span>
             <span class="br0">(</span>ForwardRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="sy3">||</span> __TinyRange<span class="sy1">&lt;</span>Pattern<span class="sy1">&gt;</span><span class="br0">)</span>
  <span class="kw1">class</span> split_view <span class="sy4">:</span> <span class="kw1">public</span> view_interface<span class="sy1">&lt;</span>split_view<span class="sy1">&lt;</span>V, Pattern<span class="sy1">&gt;&gt;</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    V base_ <span class="sy1">=</span> V<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>                              <span class="co1">// 仅用于阐释</span>
    Pattern pattern_ <span class="sy1">=</span> Pattern<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>               <span class="co1">// 仅用于阐释</span>
    iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> current_ <span class="sy1">=</span> iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>   <span class="co1">// 仅用于阐释，</span>
                                                <span class="co1">// 仅当 !ForwardRange&lt;V&gt; 时才存在</span>
    <span class="co1">// 类模板 split_­view​::​outer_­iterator</span>
    <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw4">bool</span><span class="sy1">&gt;</span> <span class="kw1">struct</span> outer_iterator<span class="sy4">;</span>       <span class="co1">// 仅用于阐释</span>
    <span class="co1">// 类模板 split_­view​::​inner_­iterator</span>
    <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw4">bool</span><span class="sy1">&gt;</span> <span class="kw1">struct</span> inner_iterator<span class="sy4">;</span>       <span class="co1">// 仅用于阐释</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    split_view<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> split_view<span class="br0">(</span>V base, Pattern pattern<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw1">template</span><span class="sy1">&lt;</span>InputRange R, ForwardRange P<span class="sy1">&gt;</span>
      requires Constructible<span class="sy1">&lt;</span>V, all_view<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span> <span class="sy3">&amp;&amp;</span>
               Constructible<span class="sy1">&lt;</span>Pattern, all_view<span class="sy1">&lt;</span>P<span class="sy1">&gt;&gt;</span>
    <span class="kw4">constexpr</span> split_view<span class="br0">(</span>R<span class="sy3">&amp;&amp;</span> r, P<span class="sy3">&amp;&amp;</span> p<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw1">template</span><span class="sy1">&lt;</span>InputRange R<span class="sy1">&gt;</span>
      requires Constructible<span class="sy1">&lt;</span>V, all_view<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span> <span class="sy3">&amp;&amp;</span>
               Constructible<span class="sy1">&lt;</span>Pattern, single_view<span class="sy1">&lt;</span>iter_value_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;&gt;&gt;</span>
    <span class="kw4">constexpr</span> split_view<span class="br0">(</span>R<span class="sy3">&amp;&amp;</span> r, iter_value_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span> e<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> begin<span class="br0">(</span><span class="br0">)</span> <span class="br0">{</span>
      <span class="kw1">if</span> <span class="kw4">constexpr</span> <span class="br0">(</span>ForwardRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="br0">)</span>
        <span class="kw1">return</span> outer_iterator<span class="sy1">&lt;</span>__SimpleView<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span><span class="br0">{</span><span class="sy2">*</span>this, ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>base_<span class="br0">)</span><span class="br0">}</span><span class="sy4">;</span>
      <span class="kw1">else</span> <span class="br0">{</span>
        current_ <span class="sy1">=</span> ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>base_<span class="br0">)</span><span class="sy4">;</span>
        <span class="kw1">return</span> outer_iterator<span class="sy1">&lt;</span><span class="kw2">false</span><span class="sy1">&gt;</span><span class="br0">{</span><span class="sy2">*</span>this<span class="br0">}</span><span class="sy4">;</span>
      <span class="br0">}</span>
    <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> begin<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> requires ForwardRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> ForwardRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span> <span class="br0">{</span>
      <span class="kw1">return</span> outer_iterator<span class="sy1">&lt;</span><span class="kw2">true</span><span class="sy1">&gt;</span><span class="br0">{</span><span class="sy2">*</span>this, ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>base_<span class="br0">)</span><span class="br0">}</span><span class="sy4">;</span>
    <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> end<span class="br0">(</span><span class="br0">)</span> requires ForwardRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> CommonRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="br0">{</span>
      <span class="kw1">return</span> outer_iterator<span class="sy1">&lt;</span>__SimpleView<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span><span class="br0">{</span><span class="sy2">*</span>this, ranges<span class="sy4">::</span><span class="me2">end</span><span class="br0">(</span>base_<span class="br0">)</span><span class="br0">}</span><span class="sy4">;</span>
    <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> end<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> <span class="br0">{</span>
      <span class="kw1">if</span> <span class="kw4">constexpr</span> <span class="br0">(</span>ForwardRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> ForwardRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> CommonRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span><span class="br0">)</span>
        <span class="kw1">return</span> outer_iterator<span class="sy1">&lt;</span><span class="kw2">true</span><span class="sy1">&gt;</span><span class="br0">{</span><span class="sy2">*</span>this, ranges<span class="sy4">::</span><span class="me2">end</span><span class="br0">(</span>base_<span class="br0">)</span><span class="br0">}</span><span class="sy4">;</span>
      <span class="kw1">else</span>
        <span class="kw1">return</span> default_sentinel<span class="sy4">;</span>
    <span class="br0">}</span>
  <span class="br0">}</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> R, <span class="kw1">class</span> P<span class="sy1">&gt;</span>
    split_view<span class="br0">(</span>R<span class="sy3">&amp;&amp;</span>, P<span class="sy3">&amp;&amp;</span><span class="br0">)</span> <span class="sy2">-</span><span class="sy1">&gt;</span> split_view<span class="sy1">&lt;</span>all_view<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>, all_view<span class="sy1">&lt;</span>P<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span>InputRange R<span class="sy1">&gt;</span>
    split_view<span class="br0">(</span>R<span class="sy3">&amp;&amp;</span>, iter_value_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span><span class="br0">)</span>
      <span class="sy2">-</span><span class="sy1">&gt;</span> split_view<span class="sy1">&lt;</span>all_view<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span>, single_view<span class="sy1">&lt;</span>iter_value_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;&gt;&gt;</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB.E6.A8.A1.E6.9D.BF_std::ranges::split_view::outer_iterator">类模板 <span class="t-lc">std::ranges::split_view::outer_iterator</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> V, <span class="kw1">class</span> Pattern<span class="sy1">&gt;</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw4">bool</span> Const<span class="sy1">&gt;</span>
  <span class="kw1">struct</span> split_view<span class="sy1">&lt;</span>V, Pattern<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">outer_iterator</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    <span class="kw1">using</span> Parent <span class="sy1">=</span>                              <span class="co1">// 仅用于阐释</span>
      conditional_t<span class="sy1">&lt;</span>Const, <span class="kw4">const</span> split_view, split_view<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw1">using</span> Base   <span class="sy1">=</span>                              <span class="co1">// 仅用于阐释</span>
      conditional_t<span class="sy1">&lt;</span>Const, <span class="kw4">const</span> V, V<span class="sy1">&gt;</span><span class="sy4">;</span>
    Parent<span class="sy2">*</span> parent_ <span class="sy1">=</span> nullptr<span class="sy4">;</span>                  <span class="co1">// 仅用于阐释</span>
    iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span> current_ <span class="sy1">=</span>                 <span class="co1">// 仅用于阐释，</span>
      iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>                       <span class="co1">// 仅当 V 构成 ForwardRange 时才存在</span>
 
  <span class="kw1">public</span><span class="sy4">:</span>
    <span class="kw1">using</span> iterator_concept  <span class="sy1">=</span>
      conditional_t<span class="sy1">&lt;</span>ForwardRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span>, forward_iterator_tag, input_iterator_tag<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw1">using</span> iterator_category <span class="sy1">=</span> input_iterator_tag<span class="sy4">;</span>
    <span class="kw1">struct</span> value_type<span class="sy4">;</span>
    <span class="kw1">using</span> difference_type   <span class="sy1">=</span> iter_difference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
 
    outer_iterator<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> <span class="kw1">explicit</span> outer_iterator<span class="br0">(</span>Parent<span class="sy3">&amp;</span> parent<span class="br0">)</span>
      requires <span class="br0">(</span><span class="sy3">!</span>ForwardRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> outer_iterator<span class="br0">(</span>Parent<span class="sy3">&amp;</span> parent, iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span> current<span class="br0">)</span>
      requires ForwardRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> outer_iterator<span class="br0">(</span>outer_iterator<span class="sy1">&lt;</span><span class="sy3">!</span>Const<span class="sy1">&gt;</span> i<span class="br0">)</span>
      requires Const <span class="sy3">&amp;&amp;</span> ConvertibleTo<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span>, iterator_t<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> value_type operator<span class="sy2">*</span><span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> outer_iterator<span class="sy3">&amp;</span> operator<span class="sy2">++</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> decltype<span class="br0">(</span><span class="kw4">auto</span><span class="br0">)</span> operator<span class="sy2">++</span><span class="br0">(</span><span class="kw4">int</span><span class="br0">)</span> <span class="br0">{</span>
      <span class="kw1">if</span> <span class="kw4">constexpr</span> <span class="br0">(</span>ForwardRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="br0">)</span> <span class="br0">{</span>
        <span class="kw4">auto</span> tmp <span class="sy1">=</span> <span class="sy2">*</span>this<span class="sy4">;</span>
        <span class="sy2">++*</span>this<span class="sy4">;</span>
        <span class="kw1">return</span> tmp<span class="sy4">;</span>
      <span class="br0">}</span> <span class="kw1">else</span>
        <span class="sy2">++*</span>this<span class="sy4">;</span>
    <span class="br0">}</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span><span class="kw4">const</span> outer_iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> outer_iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires ForwardRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span><span class="kw4">const</span> outer_iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> outer_iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires ForwardRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span><span class="kw4">const</span> outer_iterator<span class="sy3">&amp;</span> x, default_sentinel_t<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span>default_sentinel_t, <span class="kw4">const</span> outer_iterator<span class="sy3">&amp;</span> x<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span><span class="kw4">const</span> outer_iterator<span class="sy3">&amp;</span> x, default_sentinel_t y<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span>default_sentinel_t y, <span class="kw4">const</span> outer_iterator<span class="sy3">&amp;</span> x<span class="br0">)</span><span class="sy4">;</span>
  <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB_std::ranges::split_view::outer_iterator::value_type">类 <span class="t-lc">std::ranges::split_view::outer_iterator::value_type</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> V, <span class="kw1">class</span> Pattern<span class="sy1">&gt;</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw4">bool</span> Const<span class="sy1">&gt;</span>
  <span class="kw1">struct</span> split_view<span class="sy1">&lt;</span>V, Pattern<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">outer_iterator</span><span class="sy1">&lt;</span>Const<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">value_type</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    outer_iterator i_ <span class="sy1">=</span> outer_iterator<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>               <span class="co1">// 仅用于阐释</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    value_type<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> <span class="kw1">explicit</span> value_type<span class="br0">(</span>outer_iterator i<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> inner_iterator<span class="sy1">&lt;</span>Const<span class="sy1">&gt;</span> begin<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> default_sentinel_t end<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
  <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB.E6.A8.A1.E6.9D.BF_std::ranges::split_view::inner_iterator">类模板 <span class="t-lc">std::ranges::split_view::inner_iterator</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> V, <span class="kw1">class</span> Pattern<span class="sy1">&gt;</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw4">bool</span> Const<span class="sy1">&gt;</span>
  <span class="kw1">struct</span> split_view<span class="sy1">&lt;</span>V, Pattern<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">inner_iterator</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    <span class="kw1">using</span> Base <span class="sy1">=</span>
      conditional_t<span class="sy1">&lt;</span>Const, <span class="kw4">const</span> V, V<span class="sy1">&gt;</span><span class="sy4">;</span>                 <span class="co1">// 仅用于阐释</span>
    outer_iterator<span class="sy1">&lt;</span>Const<span class="sy1">&gt;</span> i_ <span class="sy1">=</span> outer_iterator<span class="sy1">&lt;</span>Const<span class="sy1">&gt;</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span> <span class="co1">// 仅用于阐释</span>
    <span class="kw4">bool</span> incremented_ <span class="sy1">=</span> <span class="kw2">false</span><span class="sy4">;</span>                          <span class="co1">// 仅用于阐释</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    <span class="kw1">using</span> iterator_concept  <span class="sy1">=</span> <span class="kw1">typename</span> outer_iterator<span class="sy1">&lt;</span>Const<span class="sy1">&gt;</span><span class="sy4">::</span><span class="me2">iterator_concept</span><span class="sy4">;</span>
    <span class="kw1">using</span> iterator_category <span class="sy1">=</span> <span class="coMULTI">/* 见定义 */</span><span class="sy4">;</span>
    <span class="kw1">using</span> value_type        <span class="sy1">=</span> iter_value_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
    <span class="kw1">using</span> difference_type   <span class="sy1">=</span> iter_difference_t<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
 
    inner_iterator<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> <span class="kw1">explicit</span> inner_iterator<span class="br0">(</span>outer_iterator<span class="sy1">&lt;</span>Const<span class="sy1">&gt;</span> i<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> decltype<span class="br0">(</span><span class="kw4">auto</span><span class="br0">)</span> operator<span class="sy2">*</span><span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> <span class="br0">{</span> <span class="kw1">return</span> <span class="sy2">*</span>i_.<span class="me1">current</span><span class="sy4">;</span> <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> inner_iterator<span class="sy3">&amp;</span> operator<span class="sy2">++</span><span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> decltype<span class="br0">(</span><span class="kw4">auto</span><span class="br0">)</span> operator<span class="sy2">++</span><span class="br0">(</span><span class="kw4">int</span><span class="br0">)</span> <span class="br0">{</span>
      <span class="kw1">if</span> <span class="kw4">constexpr</span> <span class="br0">(</span>ForwardRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="br0">)</span> <span class="br0">{</span>
        <span class="kw4">auto</span> tmp <span class="sy1">=</span> <span class="sy2">*</span>this<span class="sy4">;</span>
        <span class="sy2">++*</span>this<span class="sy4">;</span>
        <span class="kw1">return</span> tmp<span class="sy4">;</span>
      <span class="br0">}</span> <span class="kw1">else</span>
        <span class="sy2">++*</span>this<span class="sy4">;</span>
    <span class="br0">}</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span><span class="kw4">const</span> inner_iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> inner_iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires ForwardRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span><span class="kw4">const</span> inner_iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> inner_iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      requires ForwardRange<span class="sy1">&lt;</span>Base<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span><span class="kw4">const</span> inner_iterator<span class="sy3">&amp;</span> x, default_sentinel_t<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy1">==</span><span class="br0">(</span>default_sentinel_t, <span class="kw4">const</span> inner_iterator<span class="sy3">&amp;</span> x<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span><span class="kw4">const</span> inner_iterator<span class="sy3">&amp;</span> x, default_sentinel_t y<span class="br0">)</span><span class="sy4">;</span>
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">bool</span> operator<span class="sy3">!</span><span class="sy1">=</span><span class="br0">(</span>default_sentinel_t y, <span class="kw4">const</span> inner_iterator<span class="sy3">&amp;</span> x<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> decltype<span class="br0">(</span><span class="kw4">auto</span><span class="br0">)</span> iter_move<span class="br0">(</span><span class="kw4">const</span> inner_iterator<span class="sy3">&amp;</span> i<span class="br0">)</span>
    <span class="kw1">noexcept</span><span class="br0">(</span><span class="kw1">noexcept</span><span class="br0">(</span>ranges<span class="sy4">::</span><span class="me2">iter_move</span><span class="br0">(</span>i.<span class="me1">i_</span>.<span class="me1">current</span><span class="br0">)</span><span class="br0">)</span><span class="br0">)</span> <span class="br0">{</span>
      <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">iter_move</span><span class="br0">(</span>i.<span class="me1">i_</span>.<span class="me1">current</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="br0">}</span>
 
    <span class="kw1">friend</span> <span class="kw4">constexpr</span> <span class="kw4">void</span> iter_swap<span class="br0">(</span><span class="kw4">const</span> inner_iterator<span class="sy3">&amp;</span> x, <span class="kw4">const</span> inner_iterator<span class="sy3">&amp;</span> y<span class="br0">)</span>
      <span class="kw1">noexcept</span><span class="br0">(</span><span class="kw1">noexcept</span><span class="br0">(</span>ranges<span class="sy4">::</span><span class="me2">iter_swap</span><span class="br0">(</span>x.<span class="me1">i_</span>.<span class="me1">current</span>, y.<span class="me1">i_</span>.<span class="me1">current</span><span class="br0">)</span><span class="br0">)</span><span class="br0">)</span>
      requires IndirectlySwappable<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>Base<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
  <span class="br0">}</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB.E6.A8.A1.E6.9D.BF_std::ranges::common_view">类模板 <span class="t-lc">std::ranges::common_view</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span>View V<span class="sy1">&gt;</span>
    requires <span class="br0">(</span><span class="sy3">!</span>CommonRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="br0">)</span>
  <span class="kw1">class</span> common_view <span class="sy4">:</span> <span class="kw1">public</span> view_interface<span class="sy1">&lt;</span>common_view<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    V base_ <span class="sy1">=</span> V<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>  <span class="co1">// 仅用于阐释</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    common_view<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> <span class="kw1">explicit</span> common_view<span class="br0">(</span>V r<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw1">template</span><span class="sy1">&lt;</span>ViewableRange R<span class="sy1">&gt;</span>
      requires <span class="br0">(</span><span class="sy3">!</span>CommonRange<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> Constructible<span class="sy1">&lt;</span>V, all_view<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span><span class="br0">)</span>
    <span class="kw4">constexpr</span> <span class="kw1">explicit</span> common_view<span class="br0">(</span>R<span class="sy3">&amp;&amp;</span> r<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> V base<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> size<span class="br0">(</span><span class="br0">)</span> requires SizedRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="br0">{</span>
      <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">size</span><span class="br0">(</span>base_<span class="br0">)</span><span class="sy4">;</span>
    <span class="br0">}</span>
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> size<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> requires SizedRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span> <span class="br0">{</span>
      <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">size</span><span class="br0">(</span>base_<span class="br0">)</span><span class="sy4">;</span>
    <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> begin<span class="br0">(</span><span class="br0">)</span> <span class="br0">{</span>
      <span class="kw1">if</span> <span class="kw4">constexpr</span> <span class="br0">(</span>RandomAccessRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> SizedRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="br0">)</span>
        <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>base_<span class="br0">)</span><span class="sy4">;</span>
      <span class="kw1">else</span>
        <span class="kw1">return</span> common_iterator<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span>, sentinel_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span><span class="br0">(</span>ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>base_<span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> begin<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> requires Range<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span> <span class="br0">{</span>
      <span class="kw1">if</span> <span class="kw4">constexpr</span> <span class="br0">(</span>RandomAccessRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> SizedRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span><span class="br0">)</span>
        <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>base_<span class="br0">)</span><span class="sy4">;</span>
      <span class="kw1">else</span>
        <span class="kw1">return</span>
          common_iterator<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span>, sentinel_t<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;&gt;</span><span class="br0">(</span>ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>base_<span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> end<span class="br0">(</span><span class="br0">)</span> <span class="br0">{</span>
      <span class="kw1">if</span> <span class="kw4">constexpr</span> <span class="br0">(</span>RandomAccessRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> SizedRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="br0">)</span>
        <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>base_<span class="br0">)</span> <span class="sy2">+</span> ranges<span class="sy4">::</span><span class="me2">size</span><span class="br0">(</span>base_<span class="br0">)</span><span class="sy4">;</span>
      <span class="kw1">else</span>
        <span class="kw1">return</span> common_iterator<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span>, sentinel_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span><span class="br0">(</span>ranges<span class="sy4">::</span><span class="me2">end</span><span class="br0">(</span>base_<span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="br0">}</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> end<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> requires Range<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span> <span class="br0">{</span>
      <span class="kw1">if</span> <span class="kw4">constexpr</span> <span class="br0">(</span>RandomAccessRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> SizedRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span><span class="br0">)</span>
        <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">begin</span><span class="br0">(</span>base_<span class="br0">)</span> <span class="sy2">+</span> ranges<span class="sy4">::</span><span class="me2">size</span><span class="br0">(</span>base_<span class="br0">)</span><span class="sy4">;</span>
      <span class="kw1">else</span>
        <span class="kw1">return</span>
          common_iterator<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span>, sentinel_t<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;&gt;</span><span class="br0">(</span>ranges<span class="sy4">::</span><span class="me2">end</span><span class="br0">(</span>base_<span class="br0">)</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="br0">}</span>
  <span class="br0">}</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> R<span class="sy1">&gt;</span>
    common_view<span class="br0">(</span>R<span class="sy3">&amp;&amp;</span><span class="br0">)</span> <span class="sy2">-</span><span class="sy1">&gt;</span> common_view<span class="sy1">&lt;</span>all_view<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>
<h4><span class="mw-headline" id=".E7.B1.BB.E6.A8.A1.E6.9D.BF_std::ranges::reverse_view">类模板 <span class="t-lc">std::ranges::reverse_view</span></span></h4>
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="cpp source-cpp"><pre class="de1"><span class="kw1">namespace</span> std<span class="sy4">::</span><span class="me2">ranges</span> <span class="br0">{</span>
  <span class="kw1">template</span><span class="sy1">&lt;</span>View V<span class="sy1">&gt;</span>
    requires BidirectionalRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span>
  <span class="kw1">class</span> reverse_view <span class="sy4">:</span> <span class="kw1">public</span> view_interface<span class="sy1">&lt;</span>reverse_view<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span> <span class="br0">{</span>
  <span class="kw1">private</span><span class="sy4">:</span>
    V base_ <span class="sy1">=</span> V<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>  <span class="co1">// 仅用于阐释</span>
  <span class="kw1">public</span><span class="sy4">:</span>
    reverse_view<span class="br0">(</span><span class="br0">)</span> <span class="sy1">=</span> <span class="kw1">default</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> <span class="kw1">explicit</span> reverse_view<span class="br0">(</span>V r<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw1">template</span><span class="sy1">&lt;</span>ViewableRange R<span class="sy1">&gt;</span>
      requires BidirectionalRange<span class="sy1">&lt;</span>R<span class="sy1">&gt;</span> <span class="sy3">&amp;&amp;</span> Constructible<span class="sy1">&lt;</span>V, all_view<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span>
    <span class="kw4">constexpr</span> <span class="kw1">explicit</span> reverse_view<span class="br0">(</span>R<span class="sy3">&amp;&amp;</span> r<span class="br0">)</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> V base<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> reverse_iterator<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span> begin<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> reverse_iterator<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span> begin<span class="br0">(</span><span class="br0">)</span> requires CommonRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> reverse_iterator<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;&gt;</span> begin<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span>
      requires CommonRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> reverse_iterator<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span>V<span class="sy1">&gt;&gt;</span> end<span class="br0">(</span><span class="br0">)</span><span class="sy4">;</span>
    <span class="kw4">constexpr</span> reverse_iterator<span class="sy1">&lt;</span>iterator_t<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;&gt;</span> end<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span>
      requires CommonRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span><span class="sy4">;</span>
 
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> size<span class="br0">(</span><span class="br0">)</span> requires SizedRange<span class="sy1">&lt;</span>V<span class="sy1">&gt;</span> <span class="br0">{</span>
      <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">size</span><span class="br0">(</span>base_<span class="br0">)</span><span class="sy4">;</span>
    <span class="br0">}</span>
    <span class="kw4">constexpr</span> <span class="kw4">auto</span> size<span class="br0">(</span><span class="br0">)</span> <span class="kw4">const</span> requires SizedRange<span class="sy1">&lt;</span><span class="kw4">const</span> V<span class="sy1">&gt;</span> <span class="br0">{</span>
      <span class="kw1">return</span> ranges<span class="sy4">::</span><span class="me2">size</span><span class="br0">(</span>base_<span class="br0">)</span><span class="sy4">;</span>
    <span class="br0">}</span>
  <span class="br0">}</span><span class="sy4">;</span>
 
  <span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> R<span class="sy1">&gt;</span>
    reverse_view<span class="br0">(</span>R<span class="sy3">&amp;&amp;</span><span class="br0">)</span> <span class="sy2">-</span><span class="sy1">&gt;</span> reverse_view<span class="sy1">&lt;</span>all_view<span class="sy1">&lt;</span>R<span class="sy1">&gt;&gt;</span><span class="sy4">;</span>
<span class="br0">}</span></pre></div></div>

<!-- 
NewPP limit report
Preprocessor visited node count: 16433/1000000
Preprocessor generated node count: 13124/1000000
Post‐expand include size: 352520/2097152 bytes
Template argument size: 119153/2097152 bytes
Highest expansion depth: 23/40
Expensive parser function count: 0/100
-->

<!-- Saved in parser cache with key mwiki1-mwiki_zh_:pcache:idhash:11952-0!*!0!!zh!*!zh!* and timestamp 20211230193209 -->
</div>                    <!-- /bodycontent -->
                                        <!-- printfooter -->
                    <div class="printfooter">
                    来自“<a href="https://zh.cppreference.com/mwiki/index.php?title=cpp/header/ranges&amp;oldid=70022">https://zh.cppreference.com/mwiki/index.php?title=cpp/header/ranges&amp;oldid=70022</a>”                    </div>
                    <!-- /printfooter -->
                                                            <!-- catlinks -->
                    <!-- /catlinks -->
                                                            <div class="visualClear"></div>
                    <!-- debughtml -->
                                        <!-- /debughtml -->
                </div>
                <!-- /bodyContent -->
            </div>
        </div>
        <!-- /content -->
        <!-- footer -->
        <div id="cpp-footer-base" class="noprint">
            <div id="footer">
                        <div id="cpp-navigation">
            <h5>导航</h5>
            <ul><li><a href="https://zh.cppreference.com/w/cpp/header/ranges">Online version</a></li><li>Offline version retrieved 2022-01-01 00:37.</li></ul></div>
                        <ul id="footer-info">
                                    <li id="footer-info-lastmod"> 本页面最后修改于2021年4月4日 (星期日) 02:11。</li>
                                    <li id="footer-info-viewcount">此页面已被浏览过3,465次。</li>
                            </ul>
                    </div>
        </div>
        <!-- /footer -->
        <script>if(window.mw){
mw.loader.state({"site":"loading","user":"missing","user.groups":"ready"});
}</script>
<script src="../../../common/skin_scripts.js"></script>
<script>if(window.mw){
mw.loader.load(["mediawiki.action.view.postEdit","mediawiki.user","mediawiki.page.ready","mediawiki.searchSuggest","mediawiki.hidpi","ext.gadget.MathJax","ext.gadget.ColiruCompiler"], null, true);
}</script>
<script src="../../../common/site_scripts.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2828341-1']);
_gaq.push(['_setDomainName', 'cppreference.com']);
_gaq.push(['_trackPageview']);
</script><!-- Served in 5.528 secs. -->
	</body>
<!-- Cached 20211230193209 -->
</html>